gecko-dev/netwerk/test
Valentin Gosu a2675e9878 Bug 1476996 - Implement cross process redirection in Http on the parent process r=bagder,nika
This patch builds the foundation for the ability to relocate HTTP channels from one content process to another in order to ensure that origins are properly isolated. This relocation would normally occur when the response to an HTTP request is a redirect to a different origin.
The patch merely adds the mechanism for relocating the channel, rather than the logic of doing so. This will be provided in a follow-up patch by a specialized service. Right now that functionality is mocked in the test.

How this works:
In nsHttpChannel::OnStartRequest we will query the service that decides whether we need to direct the response to another process. If so, it will return a promise that resolves to a TabParent.
When the promise resolves, in HttpChannelParentListener::TriggerCrossProcessRedirect we call NeckoParent::SendCrossProcessRedirect passing along the required information to recreate the channel in the new process. The NeckoChild in the new process will then instantiate a new channel, call ConnectParent() which creates the associated parent channel, and connects it with the existing nsHttpChannel.
A listener in the new process is then notified of the existence of the new channel. It is required to call completeRedirectSetup on the channel, passing an nsIStreamListener to the call.
We then finish the entire operation with a call to HttpChannelChild::SendCrossProcessRedirectDone which causes us to close the old HttpChannelChild in the previous process and to resume the nsHttpChannel in the main process.

Differential Revision: https://phabricator.services.mozilla.com/D2958

--HG--
rename : netwerk/test/browser/browser_cookie_sync_across_tabs.js => netwerk/test/browser/browser_cross_process_redirect.js
rename : dom/media/test/redirect.sjs => netwerk/test/browser/redirect.sjs
extra : moz-landing-system : lando
2018-09-04 20:45:22 +00:00
..
browser Bug 1476996 - Implement cross process redirection in Http on the parent process r=bagder,nika 2018-09-04 20:45:22 +00:00
crashtests Bug 675518 - Add crashtest. r=me 2017-10-25 14:58:33 -04:00
gtest Bug 1448034 - Part 2: Lazily create ProxyResolution thread. r=bagder 2018-07-16 16:05:39 -07:00
httpserver Bug 1488235 follow-up: Import XPCOMUtils.jsm in head_utils.js 2018-09-03 12:18:07 -04:00
mochitests Bug 1405428 - skip-if = verify on mochitests which do not pass test-verify. r=gbrown 2018-06-10 05:01:47 -04:00
reftest
unit bug 1486724 - TRR: accept basic URI template r=valentin 2018-09-03 14:21:08 +00:00
unit_ipc Bug 1460609 - Cookies are for parents r=mayhemer 2018-06-07 14:12:37 +02:00
moz.build Bug 1394734 - Replace CONFIG['GNU_C*'] by CONFIG['CC_TYPE'] r=glandium 2017-12-07 22:09:15 +01:00
TestBind.cpp
TestCommon.h Bug 1444490 Declare classses (and one method) in network/ final to reduce virtual function calls r=nwgh 2018-03-09 08:37:18 -06:00
TestCookie.cpp Bug 1357676 - Modify failed tests r=jdm 2018-08-30 15:41:37 +00:00
TestNamedPipeService.cpp Bug 1411728 Resolve warnings in TestNamedPipeService.cpp r=froydnj 2017-10-25 15:27:41 -05:00
TestUDPSocket.cpp Bug 1453795 - Necko - Initialize member fields in classes/ structures. r=michal 2018-06-14 11:19:07 +03:00