Closed Bug 1556489 Opened 5 years ago Closed 5 years ago

Stubbed DocumentChannelParent class

Categories

(Core :: Networking, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
mozilla71
Fission Milestone M4
Tracking Status
firefox71 --- fixed

People

(Reporter: nhi, Assigned: mattwoodrow)

References

(Blocks 3 open bugs, Regressed 3 open bugs)

Details

(Whiteboard: [necko-triaged])

Attachments

(24 files, 5 obsolete files)

47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review

Implement stubbed DocumentChannelParent class with the necessary interfaces

See https://docs.google.com/document/d/15kvUKcNavFaV02_R-z6RwxL0_cEM1ygeACnkS2-aOQM/edit#bookmark=id.mevkddxiqzn0

Priority: -- → P2
Whiteboard: [necko-triaged]
Fission Milestone: --- → M4

Uploaded a (very) WIP patch, still a lot to be done here.

Assignee: nobody → matt.woodrow
Status: NEW → ASSIGNED

This class allows to encapsulate all the information required in order to create a new HttpChannel object following a redirect.

This more closely follow the code as earlier documented. To remove all ambiguities, the idl documentation was amended.

Depends on D40960

Depends on D40961

This is a cosmetic only change.

Depends on D40962

We extract the code from CSPService::AsyncOnChannelRedirect so that we can use it in a follow-up change.

Depends on D40964

Depends on D40965

Remove unused IPDLParamTraits<nsDocShellLoadState*>::Write method

Depends on D40966

The devtools listens to http-on-opening-request event which is expected to receive a nsIHttpChannel. However future changes will make it that it's not always a nsIHttpChannel that can fire such event.

As such we create an intermediary interface nsIIdentChannel and move the subset generating such event in nsIHttpChannel there.

Depends on D40967

We will need access to this method in a following change.

Depends on D40968

Under some circumstances, we will not want to propagate, following a redirect the events following the nsIChannel::LOAD_REPLACE being set.

Depends on D40969

We can deduct it from the nsIChannel argument already. In the future, the httpParent may be either HttpChannelParent or DocumentChannelParent.

Depends on D40970

This allows in the future for the nsHttpChannel to deal with things others than the HttpChannelParent.

Depends on D40971

Depends on D40973

DevTools rely on events when a new HttpChannel is opened, it needs to know when a DocumentChannel is.

Attachment #9076947 - Attachment description: Bug 1556489 - DocumentChannel → Bug 1556489 - P17. Add DocumentChannel and hook it up.

DocumentChannel acts as a replacement for HttpChannel where redirects are now entirely handled in the DocumentChannelParent. The ContentChild will receive the final nsIChannel once all redirects have been handled.

This will be required to access the Performance object from future DocumentChannel.

This will be required to access the Performance object from future DocumentChannel.

Attachment #9083888 - Attachment is obsolete: true
Attachment #9083607 - Attachment description: Bug 1556489 - P4. Fix constness. → Bug 1556489 - P5. Fix constness.
Attachment #9083608 - Attachment description: Bug 1556489 - P5. Simplify use of namespace. → Bug 1556489 - P6. Simplify use of namespace.
Attachment #9083609 - Attachment description: Bug 1556489 - P6. Make LoadInfoArgsToLoadInfo works with LoadInfo class. → Bug 1556489 - P7. Make LoadInfoArgsToLoadInfo works with LoadInfo class.
Attachment #9083610 - Attachment description: Bug 1556489 - P7. Add CSPService::ConsultCSPForRedirect → Bug 1556489 - P8. Add CSPService::ConsultCSPForRedirect
Attachment #9083612 - Attachment description: Bug 1556489 - P8. Make method static. → Bug 1556489 - P9. Make method static.
Attachment #9083613 - Attachment description: Bug 1556489 - P9. Allow to pass PostData and Headers at DocShell creation time. → Bug 1556489 - P10. Allow to pass PostData and Headers at DocShell creation time.
Attachment #9083614 - Attachment description: Bug 1556489 - P10. Add nIIdentChannel interface. → Bug 1556489 - P11. Add nIIdentChannel interface.
Attachment #9083615 - Attachment description: Bug 1556489 - P11. Move code into static utility method. → Bug 1556489 - P12. Move code into static utility method.
Attachment #9083616 - Attachment description: Bug 1556489 - P12. Add nsIRequest::LOAD_REPLACE_SILENT flag. → Bug 1556489 - P13. Add nsIRequest::LOAD_REPLACE_SILENT flag.
Attachment #9083617 - Attachment description: Bug 1556489 - P13. No longer pass nsILoadInfo to TriggerCrossProcessRedirect. → Bug 1556489 - P14. No longer pass nsILoadInfo to TriggerCrossProcessRedirect.
Attachment #9083618 - Attachment description: Bug 1556489 - P14. Move methods into dedicated nsI* interface. → Bug 1556489 - P15. Move methods into dedicated nsI* interface.
Attachment #9083619 - Attachment description: Bug 1556489 - P15. Add AddClientChannelHelperInParent helper method. → Bug 1556489 - P16. Add AddClientChannelHelperInParent helper method.
Attachment #9083620 - Attachment description: Bug 1556489 - P16. Fix nsDataChannel intermittent leak. → Bug 1556489 - P17. Fix nsDataChannel intermittent leak.
Attachment #9076947 - Attachment description: Bug 1556489 - P17. Add DocumentChannel and hook it up. → Bug 1556489 - P19. Add DocumentChannel and hook it up.
Attachment #9083622 - Attachment description: Bug 1556489 - P18. Fix devtools stack traces. → Bug 1556489 - P19. Fix devtools stack traces.
Attachment #9076947 - Attachment description: Bug 1556489 - P19. Add DocumentChannel and hook it up. → Bug 1556489 - P18. Add DocumentChannel and hook it up.
Attachment #9083863 - Attachment is obsolete: true
Attachment #9083613 - Attachment description: Bug 1556489 - P10. Allow to pass PostData and Headers at DocShell creation time. → Bug 1556489 - P10. Pass PostData and Headers at DocShell creation time.
Blocks: 1574372

This will be required to access the Performance object from future DocumentChannel.

Depends on D40961

Attachment #9086610 - Attachment is obsolete: true
Attachment #9083620 - Attachment is obsolete: true
Blocks: 1575731
Blocks: 1575807

DocumentChannel issues an extra onStateChange at the start when it switched over to the real channel.

Attachment #9083616 - Attachment description: Bug 1556489 - P13. Add nsIRequest::LOAD_REPLACE_SILENT flag. → Bug 1556489 - P13. Add nsIRequest::LOAD_REPLACE_INTERNAL flag.
Attachment #9083616 - Attachment description: Bug 1556489 - P13. Add nsIRequest::LOAD_REPLACE_INTERNAL flag. → Bug 1556489 - P13. Use LoadInfo redirect chain to determine when a channel has redirected and we should skip uri fixup.

matchRequest can be called with a nsIChannel object or a nsIWebSocketChannel so make sure we use the right object.

Note that it should be possible to QI on a nsIChannel rather than a nsIHttpChannel. This is to be investigated in a follow-up bug.

So that we can restrict QI(nsIIdentChannel) to nsIHttpChannel and DocumentChannelChild objects only.

Attachment #9088719 - Attachment description: Bug 1556489 - P25. Check request object type. r?ochameau → Bug 1556489 - P26. Check request object type. r?ochameau
Attachment #9088719 - Attachment is obsolete: true
Pushed by jyavenard@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/db78ecb81c2d
P1. Introduce ReplacementChannelConfig. r=mayhemer
https://hg.mozilla.org/integration/mozilla-inbound/rev/7f6ef423363a
P2. Use ReplacementChannelConfig across HttpChannelParent and ContentChild. r=mayhemer
https://hg.mozilla.org/integration/mozilla-inbound/rev/bdc04d1d5bf6
P3. Move logic on when to return the PerformanceStorage into nsILoadInfo. r=mayhemer
https://hg.mozilla.org/integration/mozilla-inbound/rev/35142dbc11b3
P4. Add ability to set Document object on LoadInfo. r=mayhemer,ckerschb
https://hg.mozilla.org/integration/mozilla-inbound/rev/200c8f70c117
P5. Fix constness. r=nika
https://hg.mozilla.org/integration/mozilla-inbound/rev/da52b874f3e2
P6. Simplify use of namespace. r=mayhemer
https://hg.mozilla.org/integration/mozilla-inbound/rev/cbb802bfb55d
P7. Make LoadInfoArgsToLoadInfo works with LoadInfo class. r=mayhemer
https://hg.mozilla.org/integration/mozilla-inbound/rev/81cc6c54b36e
P8. Add CSPService::ConsultCSPForRedirect. r=mayhemer,ckerschb
https://hg.mozilla.org/integration/mozilla-inbound/rev/9938adfa2397
P9. Make method static. r=nika,mayhemer
https://hg.mozilla.org/integration/mozilla-inbound/rev/fe5a0d4ba055
P10. Pass PostData and Headers at DocShell creation time. r=nika,farre
https://hg.mozilla.org/integration/mozilla-inbound/rev/33e0491a76de
P11. Add nIIdentChannel interface. r=mayhemer
https://hg.mozilla.org/integration/mozilla-inbound/rev/f653369bd04c
P12. Move code into static utility method. r=nika
https://hg.mozilla.org/integration/mozilla-inbound/rev/7476951352cb
P13. Use LoadInfo redirect chain to determine when a channel has redirected and we should skip uri fixup. r=mayhemer
https://hg.mozilla.org/integration/mozilla-inbound/rev/c994fc6ba769
P14. No longer pass nsILoadInfo to TriggerCrossProcessRedirect. r=mayhemer
https://hg.mozilla.org/integration/mozilla-inbound/rev/6a7ea8798010
P15. Move methods into dedicated nsI* interface. r=mayhemer
https://hg.mozilla.org/integration/mozilla-inbound/rev/4083a5dddfdf
P16. Add AddClientChannelHelperInParent helper method. r=asuth
https://hg.mozilla.org/integration/mozilla-inbound/rev/8acb00138b34
P18. Add DocumentChannel and hook it up. r=nika,mayhemer
https://hg.mozilla.org/integration/mozilla-inbound/rev/7a7ebdb0e451
P19. Fix devtools stack traces. r=honza,ochameau
https://hg.mozilla.org/integration/mozilla-inbound/rev/781a0defe7f8
P20 - Remove unused method. r=mayhemer
https://hg.mozilla.org/integration/mozilla-inbound/rev/bf73a38e9e5a
P21 - Cache the original referrer before url classification has been applied to send back to the content process, since the docshell expects to find the original. r=mayhemer,tnguyen
https://hg.mozilla.org/integration/mozilla-inbound/rev/06529d12b589
P22 - Manually add history entries for all DocumentChannel redirects, since these aren't exposed to the content process as channel redirects. r=kmag
https://hg.mozilla.org/integration/mozilla-inbound/rev/6125bb02952a
P23 - Only create new ClientSource objects in the content, but use the recreated info from redirects in the parent. r=asuth
https://hg.mozilla.org/integration/mozilla-inbound/rev/5cb84cd83b9d
P24. Update test to handle extra onStateChange events fired when using DocumentChannel. r=kmag
https://hg.mozilla.org/integration/mozilla-inbound/rev/4593e6d99506
P25. Make nsIIdentChannel support conditional for nsBaseChannel. r=mayhemer
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla71
Regressions: 1578374
Regressions: 1578333
Regressions: 1578325
Regressions: 1578690
Blocks: 1578714
Regressions: 1578337
Regressions: 1443414
Blocks: 1583700
Blocks: 1576714
No longer blocks: 1576714
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: