Commit Graph

620 Commits

Author SHA1 Message Date
Valentin Gosu
75c9c2a97f Bug 1579992 - Load pages into new webCOOP+COEP process type r=nika
* This patch makes pages with the `OPENER_POLICY_SAME_ORIGIN_EMBEDDER_POLICY_REQUIRE_CORP` policy load into a special `webCOOP+COEP={pageOrigin}` remote type.
* Adds `E10SUtils.WEB_REMOTE_COOP_COEP_TYPE_PREFIX="webCOOP+COEP="`
* When a COOP process switch occurs and the target page doesn't have this policy, we pass a `preferredRemoteType="web"` into `E10SUtils.getRemoteTypeForPrincipal` ensuring that we correctly get a different `remoteType`
* E10SUtils.getRemoteTypeForPrincipal is changed such that `if preferredRemoteType.startsWith(WEB_REMOTE_COOP_COEP_TYPE_PREFIX)` we don't override it with `webIsolated={pageOrigin}`.
* `coop_header.sjs` is changed to also allow setting `Cross-Origin-Embedder-Policy` headers
* `browser_httpCrossOriginOpenerPolicy.js` is changed to test that pages are correctly opened in the correct remoteType process.

Differential Revision: https://phabricator.services.mozilla.com/D48715
2019-10-21 16:56:00 +00:00
Junior Hsu
354783fc72 Bug 1566868 - network error for non empty sandboxing flag and non-null COOP r=valentin
Adjust for new spec change (comment 23)

Differential Revision: https://phabricator.services.mozilla.com/D49222
2019-10-15 06:09:26 +00:00
Junior Hsu
8d2cedda83 Bug 1574000 - Obtain COOP only over a secure context r=nika,bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D42046
2019-09-25 00:39:17 +00:00
Jean-Yves Avenard
d1d300ad3b Bug 1575744 - P2. Add nsIProcessSwitchRequestor interface. r=mayhemer,nika
Will allow for SessionStore.jsm process switching to be used by other objects than nsHttpChannel.

Differential Revision: https://phabricator.services.mozilla.com/D46015
2019-09-20 04:09:46 +00:00
Bogdan Tara
2a3b759622 Backed out 8 changesets (bug 1575744) for HttpChannelParent related assertion failures
Backed out changeset af61675dd488 (bug 1575744)
Backed out changeset bf794b9373c8 (bug 1575744)
Backed out changeset 39ffb74d2e12 (bug 1575744)
Backed out changeset c1547b3df672 (bug 1575744)
Backed out changeset 382ee8672027 (bug 1575744)
Backed out changeset 5abb38484f11 (bug 1575744)
Backed out changeset d5244c1bbfe8 (bug 1575744)
Backed out changeset c74b81debf73 (bug 1575744)
2019-09-20 06:58:44 +03:00
Jean-Yves Avenard
e0ff6ec922 Bug 1575744 - P2. Add nsIProcessSwitchRequestor interface. r=mayhemer,nika
Will allow for SessionStore.jsm process switching to be used by other objects than nsHttpChannel.

Differential Revision: https://phabricator.services.mozilla.com/D46015
2019-09-18 23:49:51 +00:00
Valentin Gosu
24be096fd9 Bug 1513574 - Remove UserAgentOverrides.jsm and UserAgentUpdates.jsm r=michal
Also removes the UA cache attached to nsILoadGroup and nsIRequestContext and the "http-on-useragent-request" observer notification.
If overriding the user agent is needed "http-on-modify-request" is equally usable (but should be used rarely, for performance reasons). A better way is using nsIDocShell.customUserAgent.

Depends on D14750

Differential Revision: https://phabricator.services.mozilla.com/D14751
2019-09-16 15:21:36 +00:00
Cosmin Sabou
b52f5cbaf7 Backed out 4 changesets (bug 1513574) for causing several browser chrome failures. CLOSED TREE
Backed out changeset 7d950fc452fb (bug 1513574)
Backed out changeset 11f015a3e739 (bug 1513574)
Backed out changeset be6959a563f6 (bug 1513574)
Backed out changeset ce51efd054b8 (bug 1513574)
2019-09-16 12:40:40 +03:00
Valentin Gosu
9d838b2fdd Bug 1513574 - Remove UserAgentOverrides.jsm and UserAgentUpdates.jsm r=michal
Also removes the UA cache attached to nsILoadGroup and nsIRequestContext and the "http-on-useragent-request" observer notification.
If overriding the user agent is needed "http-on-modify-request" is equally usable (but should be used rarely, for performance reasons). A better way is using nsIDocShell.customUserAgent.

Depends on D14750

Differential Revision: https://phabricator.services.mozilla.com/D14751
2019-09-16 08:38:24 +00:00
Matt Woodrow
0dc503330c Bug 1579765 - Don't overwrite redirect timings when we convert DocumentChannel to a real channel. r=mayhemer
DocumentChannel doesn't use the REDIRECT_INTERNAL flag when replacing itself with a real channel if there has been a real redirect handled in the parent.
This is so that the docshell knows about the URI change, and to add history entries.
The timing data however always wanted to be treated as an internal redirect, so that we don't record a new 'redirectEnd' at the time of the switch.
This adds a new parameter to ConfigureReplacementChannel so that we can more accurately describe the behaviour we need.

Differential Revision: https://phabricator.services.mozilla.com/D45150
2019-09-16 07:22:32 +00:00
Matt Woodrow
8c025129a0 Bug 1579765 - Move upload stream handling into ReplacementChannelConfig so that it gets applied to DocumentChannel as well as normal HTTP redirects. r=mayhemer
Differential Revision: https://phabricator.services.mozilla.com/D45146
2019-09-16 07:25:18 +00:00
Cosmin Sabou
84b485377b Backed out 4 changesets (bug 1513574) for Android build bustage and browser chrome failures. CLOSED TREE
Backed out changeset f155c449e516 (bug 1513574)
Backed out changeset 1f2bbbe0f781 (bug 1513574)
Backed out changeset 5f8b5f72a4ea (bug 1513574)
Backed out changeset 0e4cababccc7 (bug 1513574)
2019-09-13 21:38:18 +03:00
Valentin Gosu
05e040b6f0 Bug 1513574 - Remove UserAgentOverrides.jsm and UserAgentUpdates.jsm r=michal
Also removes the UA cache attached to nsILoadGroup and nsIRequestContext and the "http-on-useragent-request" observer notification.
If overriding the user agent is needed "http-on-modify-request" is equally usable (but should be used rarely, for performance reasons). A better way is using nsIDocShell.customUserAgent.

Depends on D14750

Differential Revision: https://phabricator.services.mozilla.com/D14751
2019-09-13 17:19:40 +00:00
Daisuke Akatsuka
d07b98214f Bug 1572933: Introduce an attribute to raise the cache priority. r=pbro,mayhemer
For now, when we turn on `disable cache` switch in DevTools[1], web page loads
the contents without using the cache. Furthermore, DevTools as well comes to
load the contents DevTools inspects without using the cache. And, if the loaded
contents from the web page and DevTools was different, becomes impossible to
inspect the content correctly.
Thus, in order to make DevTools refer the same content the web page loaded,
makes DevTools load the contents inspecting from the cache at first, no matter
if disables the switch or not.

When turns on disable cache in DevTools, `LOAD_BYPASS_CACHE` flag is set into
`loadFlags` in the `docshell`.[2] The other hand, the content DevTools inspects
is loaded from a channel DevTools creates with `LOAD_FROM_CACHE` flag.[3]
However, because this channel is belong to same `loadGroup` of the `docshell`,
`LOAD_BYPASS_CACHE` is inherited and is choosen even if `LOAD_FROM_CACHE` is set.
Thus, in this patch, we introduce an attribute `preferCacheLoadOverBypass`
which raises the priority for `LOAD_FROM_CACHE` above `LOAD_BYPASS_CACHE` and
`LOAD_BYPASS_LOCAL_CACHE`.

[1] https://developer.mozilla.org/en-US/docs/Tools/Settings#Advanced_settings
[2] https://searchfox.org/mozilla-central/source/devtools/server/actors/targets/browsing-context.js#1227
[3] https://searchfox.org/mozilla-central/source/devtools/shared/DevToolsUtils.js#542-544

Differential Revision: https://phabricator.services.mozilla.com/D44626
2019-09-09 00:57:05 +00:00
Matt Woodrow
343e16b2dd Bug 1556489 - 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
Differential Revision: https://phabricator.services.mozilla.com/D42258
2019-09-03 10:19:52 +10:00
Matt Woodrow
79c7f2fcf6 Bug 1556489 - P14. No longer pass nsILoadInfo to TriggerCrossProcessRedirect. r=mayhemer
We can deduct it from the nsIChannel argument already. In the future, the httpParent may be either HttpChannelParent or DocumentChannelParent.

Differential Revision: https://phabricator.services.mozilla.com/D40971
2019-09-03 10:19:36 +10:00
Jean-Yves Avenard
3236e93b99 Bug 1556489 - P11. Add nIIdentChannel interface. r=mayhemer
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.

Differential Revision: https://phabricator.services.mozilla.com/D40968
2019-09-03 10:19:34 +10:00
Jean-Yves Avenard
94ea96df9a Bug 1556489 - P3. Move logic on when to return the PerformanceStorage into nsILoadInfo. r=mayhemer
This more closely follow the code as earlier documented. To remove all ambiguities, the idl documentation was amended.

Differential Revision: https://phabricator.services.mozilla.com/D40961
2019-09-03 09:50:05 +10:00
Jean-Yves Avenard
b55014e845 Bug 1556489 - P1. Introduce ReplacementChannelConfig. r=mayhemer
This class allows to encapsulate all the information required in order to create a new HttpChannel object following a redirect.

Differential Revision: https://phabricator.services.mozilla.com/D40959
2019-09-03 09:47:17 +10:00
Ehsan Akhgari
578379573b Bug 1576109 - Ensure that the content blocking allow list principal is set correctly during HTTP redirects; r=baku,dragana
Differential Revision: https://phabricator.services.mozilla.com/D43541
2019-08-29 18:48:43 +00:00
Junior Hsu
7264a36364 Bug 1574603 - recognize COOP:unsafe-allow-outgoing r=kershaw
Differential Revision: https://phabricator.services.mozilla.com/D42367
2019-08-21 13:37:07 +00:00
Thomas Nguyen
c05a8b9882 Bug 1528697 - Remove ReferrerPolicy.h and add utils to ReferrerInfo r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D41956
2019-08-21 12:09:06 +00:00
Thomas Nguyen
a688b675a4 Bug 1528697 - Expose ReferrerPolicy.webidl and use referrerpolicy enum r=smaug
ReferrerPolicy gets tossed back and forth as a uint32_t and
ReferrerPolicy enum in header file. Expose ReferrerPolicyValues from
webidl file and use consistently in native code.

Differential Revision: https://phabricator.services.mozilla.com/D41954
2019-08-21 13:24:45 +00:00
Ehsan Akhgari
ddb1c59974 Bug 1572240 - Part 3: Introduce nsIHttpChannelInternal.contentBlockingAllowListPrincipal; r=michal
Differential Revision: https://phabricator.services.mozilla.com/D42204
2019-08-19 19:38:50 +00:00
Sylvestre Ledru
3067b10938 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D41559
2019-08-13 07:15:25 +00:00
Junior Hsu
8e716704b0 Bug 1543066 - P2 Do not obtain a cross-origin opener-policy through non-HTTPS r=nika
Differential Revision: https://phabricator.services.mozilla.com/D40671
2019-08-13 02:03:32 +00:00
Junior Hsu
0453db8548 Bug 1543066 - P1 Implement COOP:unsafe-inherit r=nika
Differential Revision: https://phabricator.services.mozilla.com/D40356
2019-08-10 23:24:41 +00:00
Csoregi Natalia
d900e7f8f2 Backed out 2 changesets (bug 1543066) for COOP related failures on new_window_null.tentative.html. CLOSED TREE
Backed out changeset 8b50000b89dd (bug 1543066)
Backed out changeset 20f44d88ae9c (bug 1543066)
2019-08-11 02:18:57 +03:00
Junior Hsu
c8702bf41b Bug 1543066 - P2 Do not obtain a cross-origin opener-policy through non-HTTPS r=nika
Differential Revision: https://phabricator.services.mozilla.com/D40671
2019-08-10 18:00:01 +00:00
Junior Hsu
115ff57c42 Bug 1543066 - P1 Implement COOP:unsafe-inherit r=nika
Differential Revision: https://phabricator.services.mozilla.com/D40356
2019-08-10 18:16:20 +00:00
Junior Hsu
44b585620c Bug 1543068 - P3 Take COEP into account for COOP mismatch r=nika
Step 9 in obtain a cross-origin opener-policy
https://gist.github.com/annevk/6f2dd8c79c77123f39797f6bdac43f3e

Differential Revision: https://phabricator.services.mozilla.com/D38950
2019-08-08 19:00:00 +00:00
Tom Schuster
4677ddb1c8 Bug 1558915 - Use infallible nsIURI::SchemeIs in netwerk/. r=baku
Sorry I had some problems figuring out who can review netwerk/. Most people seem to be on PTO.

Differential Revision: https://phabricator.services.mozilla.com/D41175
2019-08-08 13:02:36 +00:00
Kris Maglione
92565fdb4d Bug 1566186: Part 1 - Remove DocShell support for isolated mozbrowsers. r=nika
This functionality is currently unused, and blocks work needed to support
Fission.

Differential Revision: https://phabricator.services.mozilla.com/D39542
2019-07-16 16:40:19 -07:00
Thomas Nguyen
1472cd5b8c Bug 1567573 - Apply Referrer-Policy header from redirect response r=michal
Differential Revision: https://phabricator.services.mozilla.com/D38879
2019-07-29 13:51:17 +00:00
Eugen Sawin
a1ed1388af Bug 1501108 - [1.7] Add GeckoView Session Context ID support. r=snorp,baku,mayhemer
Differential Revision: https://phabricator.services.mozilla.com/D19182
2019-07-21 17:18:37 +00:00
Andrea Marchesini
52c7de74a5 Bug 1563313 - Remove too strict assertions in nsHttpChannel, r=mayhemer
Differential Revision: https://phabricator.services.mozilla.com/D37161
2019-07-16 14:17:32 +00:00
Mihai Alexandru Michis
f3a540d1a9 Backed out 2 changesets (bug 1563313) for failures in test_protocolproxyservice.js CLOSED TREE
Backed out changeset 0585bc6ff55b (bug 1563313)
Backed out changeset 3b9ef89d8c5c (bug 1563313)
2019-07-15 23:57:57 +03:00
Andrea Marchesini
6f659423a3 Bug 1563313 - Remove too strict assertions in nsHttpChannel, r=mayhemer
Differential Revision: https://phabricator.services.mozilla.com/D37161
2019-07-15 13:07:07 +00:00
Ciure Andrei
b8d9a4be2c Backed out 3 changesets (bug 1563313) for causing various xpcshell tests to perma fail CLOSED TREE
Backed out changeset 55ecf0dacd00 (bug 1563313)
Backed out changeset 624d3e47b069 (bug 1563313)
Backed out changeset 5c7df32d9028 (bug 1563313)
2019-07-15 15:46:04 +03:00
Andrea Marchesini
4f45961df7 Bug 1563313 - Remove too strict assertions in nsHttpChannel, r=mayhemer
Differential Revision: https://phabricator.services.mozilla.com/D37161
2019-07-15 11:38:09 +00:00
Valentin Gosu
252d385203 Bug 1555036 - If there is a Cross-Origin-Opener-Policy mismatch and the SANDBOXED_AUXILIARY_NAVIGATION is set navigate to a network error r=mayhemer
Differential Revision: https://phabricator.services.mozilla.com/D34420
2019-06-14 21:48:51 +00:00
Sebastian Streich
c93796ebe8 Bug 1450965 Skip Cors Check for Early WebExtention Redirects r=mayhemer
Differential Revision: https://phabricator.services.mozilla.com/D30509
2019-06-13 09:57:13 +00:00
Andrea Marchesini
f47626e250 Bug 1436674 - nsICookieService.idl should use ACString XPIDL type in place of the string type, r=Ehsan
Differential Revision: https://phabricator.services.mozilla.com/D32662
2019-05-31 09:36:44 +00:00
Valentin Gosu
b229a5db58 Bug 1529911 - Ensure that mOnStartRequestCalled/mOnStopRequestCalled is set just before calling the listener to avoid reentrancy issues r=mayhemer
Differential Revision: https://phabricator.services.mozilla.com/D20499
2019-05-22 13:48:59 +00:00
Valentin Gosu
2303c4c150 Bug 1525640 - Add nsIHttpChannelInternal.isResolvedByTRR r=dragana
Differential Revision: https://phabricator.services.mozilla.com/D26884
2019-05-06 16:38:16 +00:00
Valentin Gosu
46a1f2c844 Bug 1525640 - Rename nsIHttpChannelInternal.trr to .isHttpServiceChannel to avoid confusion r=dragana
Differential Revision: https://phabricator.services.mozilla.com/D26883
2019-05-06 16:37:01 +00:00
Bogdan Tara
c1b74b6491 Backed out 3 changesets (bug 1525640) for frequent wpt failures CLOSED TREE
Backed out changeset d9a454afe9bf (bug 1525640)
Backed out changeset 19aa991328cb (bug 1525640)
Backed out changeset 4294abed890f (bug 1525640)
2019-05-03 00:16:20 +03:00
Valentin Gosu
42f1de490b Bug 1525640 - Add nsIHttpChannelInternal.isResolvedByTRR r=dragana
Differential Revision: https://phabricator.services.mozilla.com/D26884
2019-05-02 12:53:45 +00:00
Valentin Gosu
3b6b28f57e Bug 1525640 - Rename nsIHttpChannelInternal.trr to .isHttpServiceChannel to avoid confusion r=dragana
Differential Revision: https://phabricator.services.mozilla.com/D26883
2019-05-02 12:53:38 +00:00
Thomas Nguyen
e7e625129f Bug 1532318 - part 1: use ReferrerInfo class in nsIHttpChannel instead of referrer and referrer policy r=valentin,ckerschb,michal
Differential Revision: https://phabricator.services.mozilla.com/D22783
2019-05-02 12:34:52 +00:00