Commit Graph

7141 Commits

Author SHA1 Message Date
Noemi Erli
7e23372938 Merge mozilla-central to autoland. a=merge CLOSED TREE
--HG--
extra : rebase_source : de8796d5d7d7079af1b895a2f537371885f8cc6c
2019-02-26 00:09:40 +02:00
Christoph Kerschbaumer
c8bb3d7749 Bug 1529869: Remove the 2 from speculate speculative(Anonymous)Connect2 within nsISpeculativeConnect.idl. r=valentin 2019-02-24 20:26:56 +01:00
Nika Layzell
a5cbaaf6e7 Bug 1522579 - Part 4: Remove {As,Is}ContentParent, r=mccr8
These casts are now unnecessary after Part 2, due to all consumers directly
using `ContentParent`.

Depends on D20551

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

--HG--
extra : moz-landing-system : lando
2019-02-25 20:04:51 +00:00
Alex Gaynor
0e903787da Bug 1415508 - use Span in constructing a byte input stream; r=mayhemer
Differential Revision: https://phabricator.services.mozilla.com/D20687

--HG--
extra : moz-landing-system : lando
2019-02-25 19:11:20 +00:00
Agi Sferro
d6b900089c Bug 1522137 - Make resource://android return a nsIJARURI. r=snorp,mayhemer,bzbarsky
resource://android URIs always point to a "jar:" URI so it doesn't make sense
that the returned URL object implements nsIFileURL.

This also makes it so extensions can be loaded from a resource://android URI.

Audited all places where we use `nsIJARURI` and check for places where we
assume it looks like `jar:`: the only (!) place where we do that is here:

https://searchfox.org/mozilla-central/rev/b36e97fc776635655e84f2048ff59f38fa8a4626/dom/xhr/XMLHttpRequestMainThread.cpp#1852

Where we have special handling for `jar:` URIs. It looks like we would have
less special handling for such a request to a `resource://android` and it could
be fixed by just checking for the interface instead, but that's what's already
happening today so it should work. That code is never reached for
`resource://android` URIs as `mIsMappedArrayBuffer` is false for those URIs
(see #2822). And the code is consistent in checking for the scheme instead of
the interface (the other check is here:
https://searchfox.org/mozilla-central/rev/b36e97fc776635655e84f2048ff59f38fa8a4626/dom/xhr/XMLHttpRequestMainThread.cpp#2822)

Audited all places where we do `EqualsLiteral("jar")`:
https://searchfox.org/mozilla-central/search?q=.EqualsLiteral%28%22jar%22%29&path=

`SubstituteRemoteChannel`: looks interesting, but uses
`nsISubstitutingProtocolHandler::ResolveURI` to first get the real URI (which
is a `jar:`) so it works for our case.

https://searchfox.org/mozilla-central/rev/b36e97fc776635655e84f2048ff59f38fa8a4626/netwerk/protocol/res/ExtensionProtocolHandler.cpp#414

`SubstitutingProtocolHandler.cpp`

This case is explicitly fixed by this change, making it account for both
`"jar"` and `"resource"`.

https://searchfox.org/mozilla-central/rev/b36e97fc776635655e84f2048ff59f38fa8a4626/netwerk/protocol/res/SubstitutingProtocolHandler.cpp#299

`ReadSourceFromFileName`: this also looks interesting, but uses the channel to
get the URI which returns the real `"jar"` URI and not the mapped `"resource"`.

https://searchfox.org/mozilla-central/rev/b36e97fc776635655e84f2048ff59f38fa8a4626/js/xpconnect/src/XPCJSRuntime.cpp#2837

`nsStringBundle.cpp`

Accounts for both `"jar"` and `"resource"`, so it should work the same.

https://searchfox.org/mozilla-central/rev/b36e97fc776635655e84f2048ff59f38fa8a4626/intl/strres/nsStringBundle.cpp#437

Audited all places where we use `nsINestedURI` to make sure they would work for
a `nsIJARURI` which does not implement `nsINestedURI`.

`BrowserContentHandler.jsm`

Uses `nsINestedURI` to figure out if a URI is local or not and then it checks
whether it's a `"file"`, `"resource"` or `"chrome"` URI, for a `nsIJARURI &
nsINestedURI` it would return a `"file"` which passes the test, for a
`nsIJARURI` alone it would return `"resource"` which is also considered local
by this code, so the result wouldn't change.

https://searchfox.org/mozilla-central/rev/b36e97fc776635655e84f2048ff59f38fa8a4626/browser/components/BrowserContentHandler.jsm#395-399

`nsScriptSecurityManager.cpp`

`GetOriginFromURI`: This is the reason why `SubstitutingJARURI` doesn't
implement `nsINestedURI`, the origin is computed starting from the innermost
URI, which in our case would be a file. The behavior in our case is that the
origin from a `resource://android` URI behaves like other `resource://` URIs,
which is what we expect.

https://searchfox.org/mozilla-central/rev/b36e97fc776635655e84f2048ff59f38fa8a4626/caps/nsScriptSecurityManager.cpp#169

`CheckLoadURIWithPrincipal`: for `nsIJARURI & nsINestedURI` this code will only
allow pages from the same jar to be in the same origin (which is correct), for
`nsIJARURI` this code is unreachable and it would allow every
`resource://android` to load every other `resource://android` URI (which is
essentially the same thing).

https://searchfox.org/mozilla-central/rev/b36e97fc776635655e84f2048ff59f38fa8a4626/caps/nsScriptSecurityManager.cpp#874-876

`nsDocShell.cpp`

`DisplayLoadError`: Just looping through the nested URI chain to build an error
message, no concerns here (it would just ignore the `jar:` part, which is
fine).

https://searchfox.org/mozilla-central/rev/b36e97fc776635655e84f2048ff59f38fa8a4626/docshell/base/nsDocShell.cpp#3986

`DoURILoad`: Looking for `view-source`, no concerns for `resource://android`.

https://searchfox.org/mozilla-central/rev/b36e97fc776635655e84f2048ff59f38fa8a4626/docshell/base/nsDocShell.cpp#9645

`nsObjectLoadingContent.cpp`

Also looking for `view-source`, no concerns.

https://searchfox.org/mozilla-central/rev/b36e97fc776635655e84f2048ff59f38fa8a4626/dom/base/nsObjectLoadingContent.cpp#2004

`nsIconURI.cpp`/`nsIconURI.h`

Exposing `nsINestedURI`. No concerns.

https://searchfox.org/mozilla-central/rev/b36e97fc776635655e84f2048ff59f38fa8a4626/image/decoders/icon/nsIconURI.cpp#58

`nsJARURI.cpp`/`nsJARURI.h`

Exposing `nsINestedURI`, the subject of this audit.

https://searchfox.org/mozilla-central/rev/b36e97fc776635655e84f2048ff59f38fa8a4626/modules/libjar/nsJARURI.cpp#45

`nsIOService.cpp`

`URIChainHasFlags`: This code looks at the chain of nested URIs to figure out
if the chain of protocols has a certain flags. for `nsIJARURI & nsINestedURI`
it would look at both `jar:` and `file:` protocols, while in `nsIJARURI` it
would only look at the `resource:` protocol, which is our intention, since we
want this URI to be treated like a `resource:` URI and nothing else. Note the
`resource:` URI is always local (enforced by `NewURI`), so this should be ok.

https://searchfox.org/mozilla-central/rev/b36e97fc776635655e84f2048ff59f38fa8a4626/netwerk/base/nsIOService.cpp#1494

`nsNetUtil.cpp`/`nsNetUtil.h`

Implementation of `NS_ImplGetInnermostURI`, which wouldn't work for `nsIJARURI`
alone, as expected.

https://searchfox.org/mozilla-central/rev/b36e97fc776635655e84f2048ff59f38fa8a4626/netwerk/base/nsNetUtil.h#704

`nsSimpleNestedURI.cpp`/`nsSimpleNestedURI.h`

Implementing `nsINestedURI` for `nsSimpleNestedURI`, no concerns.

https://searchfox.org/mozilla-central/rev/b36e97fc776635655e84f2048ff59f38fa8a4626/netwerk/base/nsSimpleNestedURI.cpp#19

`nsViewSourceHandler.cpp`

Looking at `view-source` inner URI to get the flags, no concerns.

https://searchfox.org/mozilla-central/rev/b36e97fc776635655e84f2048ff59f38fa8a4626/netwerk/protocol/viewsource/nsViewSourceHandler.cpp#49

`nsHtml5StreamParser.cpp`/`nsHtml5TreeOpExecutor.cpp`

More `view-source` handling code. No concerns.

https://searchfox.org/mozilla-central/rev/b36e97fc776635655e84f2048ff59f38fa8a4626/parser/html/nsHtml5StreamParser.cpp#310

https://searchfox.org/mozilla-central/rev/b36e97fc776635655e84f2048ff59f38fa8a4626/parser/html/nsHtml5TreeOpExecutor.cpp#884

`DownloadPlatform.cpp`

`IsURLPossiblyFromWeb`: This line is unreachable as the method would return
true because resource has `URI_IS_UI_RESOURCE`.

https://searchfox.org/mozilla-central/rev/b36e97fc776635655e84f2048ff59f38fa8a4626/toolkit/components/downloads/DownloadPlatform.cpp#314

`getAnonymizedPath`: This code looks a little scary, and it's the first one
that seems to conflate the fact that `jar: == nsINestedURI`.

On the android case (line 2130) this code manually replaces the
`resource://android` URI with a `jar:` URI, so it wouldn't matter whether
`resource://android` implements `nsINestedURI` or not.

Actually this code could be a lot easier by using
`nsISubstitutingURL::resolveURI`, maybe I should open a bug.

https://searchfox.org/mozilla-central/rev/b36e97fc776635655e84f2048ff59f38fa8a4626/toolkit/components/search/SearchService.jsm#2148

`getRemoteTypeForURIObject`: This also looks interesting. The switch at line
157 would go straight to line 218 for `resource:` URIs (irrespective of
`nsINestedURI`) and then for `nsINestedURI` we would look at the `jar:` URI
(and eventually the `file:` URI). While for not `nsINestedURI` we would call
straight to `validatedWebRemoteType`. This might return `WEB_REMOTE_TYPE`
instead of `FILE_REMOTE_TYPE`, but since it's already happening it should be ok
(`resource://android` maps _today_ to a `jar:` file that return
`WEB_RETURN_TYPE`)

https://searchfox.org/mozilla-central/rev/b36e97fc776635655e84f2048ff59f38fa8a4626/toolkit/modules/E10SUtils.jsm#150

`getURIHost`:

This is another piece of code that benefits from not implementing
`nsINestedURI` as the host would be correctly `"android"` instead of the apk
path.

https://searchfox.org/mozilla-central/rev/b36e97fc776635655e84f2048ff59f38fa8a4626/toolkit/mozapps/downloads/DownloadUtils.jsm#390

`initDialog`:

Download dialog would show the `resource://android` URI instead of the actual
`jar:` URI, kind of expected.

https://searchfox.org/mozilla-central/rev/b36e97fc776635655e84f2048ff59f38fa8a4626/toolkit/mozapps/downloads/HelperAppDlg.jsm#423

There are no places in the codebase where we do `== "jar"`. Looks like I've
already looked at all hits for "jar" too.

Checked for `"jar:` too and It looks like they are all from code that tries to
build a `jar:` URI manually which is fine for this change.

Audited all `schemeIs("jar")` occurrences:
https://searchfox.org/mozilla-central/search?q=schemeIs(%22jar%22)&path=

`browser-identity.js`

Uses the channel URI which is always resolved to `jar:`, so that works
regardless.  See also:
https://searchfox.org/mozilla-central/rev/b36e97fc776635655e84f2048ff59f38fa8a4626/netwerk/protocol/res/SubstitutingProtocolHandler.cpp#229

https://searchfox.org/mozilla-central/rev/b36e97fc776635655e84f2048ff59f38fa8a4626/browser/base/content/browser-siteIdentity.js#812

`tabbrowser.js`

Only for `scheme == "about"` URIs.

https://searchfox.org/mozilla-central/rev/b36e97fc776635655e84f2048ff59f38fa8a4626/browser/base/content/tabbrowser.js#789

`HelperAppDialog.js`

Treats "jar:" and "resource" the same way.

https://searchfox.org/mozilla-central/rev/dc0adc07db3df9431a0876156f50c65d580010cb/mobile/android/components/HelperAppDialog.js#63

`WebNavigationContent.js`

This code checks if the scheme is "jar" and if the original URI is "resource"
it will use that instead, so in our case it will use the "resource" URI either
way.

https://searchfox.org/mozilla-central/rev/dc0adc07db3df9431a0876156f50c65d580010cb/toolkit/modules/addons/WebNavigationContent.js#158

Depends on D18740

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

--HG--
extra : moz-landing-system : lando
2019-02-25 15:38:33 +00:00
Agi Sferro
3ba359e0a9 Bug 1522137 - Move resource://android handler to C++. r=mayhemer
This is needed to make the handler to avoid race conditions where some code
tries to access a resource://android URI before the handler has been
registered.

Depends on D18739

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

--HG--
extra : moz-landing-system : lando
2019-02-25 15:38:21 +00:00
Agi Sferro
31607a16bb Bug 1522137 - Fix HasSubstitution for special cases. r=bzbarsky
Before this change, HasSubstitution would return false for "gre" or "app" which
is incorrect, since these handlers exist.

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

--HG--
extra : moz-landing-system : lando
2019-02-25 15:38:08 +00:00
Andreea Pavel
cd1b27ad4d Backed out 6 changesets (bug 1522579) for build bustages on a CLOSED TREE
Backed out changeset 3c8320baa230 (bug 1522579)
Backed out changeset 0a288a3d85cd (bug 1522579)
Backed out changeset ecfd27e7d150 (bug 1522579)
Backed out changeset eda40fca0758 (bug 1522579)
Backed out changeset 5c7aafa32a0a (bug 1522579)
Backed out changeset a3c5a2c16411 (bug 1522579)
2019-02-25 18:19:38 +02:00
Nika Layzell
73b719457a Bug 1522579 - Part 4: Remove {As,Is}ContentParent, r=mccr8
These casts are now unnecessary after Part 2, due to all consumers directly
using `ContentParent`.

Depends on D20551

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

--HG--
extra : moz-landing-system : lando
2019-02-25 15:51:21 +00:00
Dorel Luca
4a4dcd57fa Backed out 4 changesets (bug 1525319) for Android failures in dom/base/test/test_progress_events_for_gzip_data.html
Backed out changeset b73f033efb41 (bug 1525319)
Backed out changeset 1d318d5c6b98 (bug 1525319)
Backed out changeset 6d73418988d4 (bug 1525319)
Backed out changeset 84ca79bd2dc3 (bug 1525319)
2019-02-25 04:06:11 +02:00
Jonathan Kingston
63ab2bd8aa Bug 1525319 - Removing context from OnDataAvailable r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D20881

--HG--
extra : moz-landing-system : lando
2019-02-24 20:27:55 +00:00
Jonathan Kingston
332531fa9c Bug 1525319 - Removing context from OnStopRequest r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D20770

--HG--
extra : moz-landing-system : lando
2019-02-24 20:26:59 +00:00
Jonathan Kingston
2441197975 Bug 1525319 - Removing context from OnStartRequest r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D20769

--HG--
extra : moz-landing-system : lando
2019-02-24 20:26:16 +00:00
Nika Layzell
4b1ca2241a Bug 1528493 - Part 2: Move OptionalIPCStream to use new maybe types, r=baku
Depends on D20067

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

--HG--
extra : moz-landing-system : lando
2019-02-22 18:46:14 +00:00
Valentin Gosu
6c62662e9d Bug 1520062 - Also release listeners in HttpChannelChild::ActorDestroy r=kershaw
Differential Revision: https://phabricator.services.mozilla.com/D16549

--HG--
extra : moz-landing-system : lando
2019-02-20 16:06:08 +00:00
Valentin Gosu
dd38890459 Bug 1520062 - Don't exit HttpChannelChild::DoOnStopRequest if call returns error code r=kershaw
Differential Revision: https://phabricator.services.mozilla.com/D16548

--HG--
extra : moz-landing-system : lando
2019-02-20 16:06:17 +00:00
Christoph Kerschbaumer
6aa899d845 Bug 1528973: Move newProxiedChannel2 being the only implementation within nsIProxiedProtocolHandler.idl. r=valentin 2019-02-19 15:42:42 +01:00
Christoph Kerschbaumer
08be3dab62 Bug 1529252: Remove the 2 from the various version to create a channel within nsIIOService.idl. r=valentin 2019-02-21 12:48:20 +01:00
Oana Pop Rus
b36e97fc77 Merge inbound to mozilla-central. a=merge 2019-02-21 11:31:00 +02:00
Cosmin Sabou
9f8b29287b Merge mozilla-central to autoland. 2019-02-21 05:43:34 +02:00
Cosmin Sabou
f3db52f4cf Merge mozilla-inbound to mozilla-central. a=merge 2019-02-21 05:42:03 +02:00
Christoph Kerschbaumer
54df1cb98c Bug 1528677: Remove nullchecks for loadinfo since we have loadinfo on all channels. r=baku 2019-02-20 13:27:25 +01:00
Valentin Gosu
cee418d221 Bug 1529274 - Remove debugging code for bug 1153929 r=JuniorHsu
The code was added to diagnose an issue that was likely due to heap corruption.
The vtable of the objects was sometimes 0. More details in bug 1153929.
That crash doesn't reproduce anymore so it should be OK to remove.

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

--HG--
extra : moz-landing-system : lando
2019-02-20 21:02:23 +00:00
Andrea Marchesini
64d3f6f9da Bug 1487113 - nsICacheInfoChannel.preferAlternativeDataType() should expose alt-data as optional if required, r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D20200

--HG--
extra : moz-landing-system : lando
2019-02-20 10:05:42 +00:00
Masatoshi Kimura
e25fbce870 Bug 1528651 - Re-enable warnings-as-errors on Windows in some directories. r=dmajor
--HG--
extra : source : ba86ea25070b37f4725834e1c2d9ec4c0783e119
2019-02-17 15:03:02 +09:00
Valentin Gosu
7ddb1bc889 Bug 1528188 - Get the HttpChannelParentListener via the parent r=mayhemer
Differential Revision: https://phabricator.services.mozilla.com/D20184

--HG--
extra : moz-landing-system : lando
2019-02-18 21:37:44 +00:00
Coroiu Cristina
e6520f0a4d Merge inbound to mozilla-central a=merge 2019-02-16 11:36:46 +02:00
Valentin Gosu
a5cc5b2a87 Bug 1521808 - Implement process switching based on Cross-Opener-Origin-Policy header r=nika,qdot
* New topLevel loads get the nsILoadInfo.openerPolicy of the current top level document
* Parsing the Cross-Opener-Origin-Policy of a channel will update mLoadInfo.openerPolicy and this value will get propagated to the child process.
* SessionStore now checks nsIHttpChannel.hasCrossOriginOpenerPolicyMismatch (preffed off) and performs a process switch if needed

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

--HG--
rename : toolkit/components/remotebrowserutils/tests/browser/browser_httpResponseProcessSelection.js => toolkit/components/remotebrowserutils/tests/browser/browser_httpCrossOriginOpenerPolicy.js
extra : moz-landing-system : lando
2019-02-15 22:02:47 +00:00
Valentin Gosu
38f19c2395 Bug 1521808 - Use topWindowPrincipal for CrossOriginOpenerPolicy check r=mayhemer,nika
- Adds nsIHttpChannelInternal.setTopWindowPrincipal used to pass the principal from the child to the parent

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

--HG--
extra : moz-landing-system : lando
2019-02-15 22:28:56 +00:00
Valentin Gosu
865d80fff4 Bug 1521808 - Implement Cross-Origin-Opener-Policy header r=nika,mayhemer
Differential Revision: https://phabricator.services.mozilla.com/D18119

--HG--
extra : moz-landing-system : lando
2019-02-15 22:02:58 +00:00
Nika Layzell
15e8803fb2 Bug 1522637 - Part 6: Perform process switches separtely from on-examine-response, r=valentin
Issues were occuring where a process swap would be decided upon during
on-examine-response, but before the swap could be handled by the
channel, the channel was redirected.

This new code takes the mildly hacky approach of simply using a separate
observer notification which is fired at the correct time. A better
solution may be to use a dedicated service for responding to these
events, however that was not implemented for this initial patch.

Depends on D18606

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

--HG--
extra : moz-landing-system : lando
2019-02-15 19:49:17 +00:00
Cosmin Sabou
a4b19fcd61 Merge mozilla-inbound to mozilla-central. a=merge
--HG--
rename : browser/components/nsBrowserContentHandler.js => browser/components/BrowserContentHandler.jsm
2019-02-15 20:39:45 +02:00
Cosmin Sabou
fab429586f Merge autoland to mozilla-central. a=merge 2019-02-15 20:36:32 +02:00
Cosmin Sabou
ba308a2f90 Backed out 4 changesets (bug 1521808) for causing merge conflicts.
Backed out changeset 42641f88d7da (bug 1521808)
Backed out changeset 32ce09b2c33a (bug 1521808)
Backed out changeset 94e513102b53 (bug 1521808)
Backed out changeset a08553c07886 (bug 1521808)
2019-02-15 20:34:07 +02:00
Razvan Maries
d93d94cbc9 Backed out 9 changesets (bug 1522637) for causing bug 1528188. a=backout
Backed out changeset e4ca191d62a5 (bug 1522637)
Backed out changeset 540e5f318768 (bug 1522637)
Backed out changeset 0886a317a108 (bug 1522637)
Backed out changeset 4c7c512a262d (bug 1522637)
Backed out changeset d7eb272688be (bug 1522637)
Backed out changeset 67e838f49f4b (bug 1522637)
Backed out changeset 7e38890c72fa (bug 1522637)
Backed out changeset e6ca9ad18d15 (bug 1522637)
Backed out changeset 0f759e91eca8 (bug 1522637)
2019-02-15 18:21:36 +02:00
Nika Layzell
a2bc82eb15 Bug 1522637 - Part 7: Perform process switches separtely from on-examine-response, r=valentin
Issues were occuring where a process swap would be decided upon during
on-examine-response, but before the swap could be handled by the
channel, the channel was redirected.

This new code takes the mildly hacky approach of simply using a separate
observer notification which is fired at the correct time. A better
solution may be to use a dedicated service for responding to these
events, however that was not implemented for this initial patch.

Depends on D18607

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

--HG--
extra : source : 3d24e8e81c02af9d1edec7571afecefb0d2f1eb4
2019-02-14 15:37:06 +00:00
Bogdan Tara
c732fccb1e Backed out 8 changesets (bug 1522637) for browser_all_files_referenced.js failures CLOSED TREE
Backed out changeset f7ab0e6e739b (bug 1522637)
Backed out changeset 3d24e8e81c02 (bug 1522637)
Backed out changeset 41ca0b87537e (bug 1522637)
Backed out changeset 6e0d4b6b1c93 (bug 1522637)
Backed out changeset 8f494271ec06 (bug 1522637)
Backed out changeset 6b4d010964ec (bug 1522637)
Backed out changeset 5eeda2ba8e79 (bug 1522637)
Backed out changeset 5988b8e7d17c (bug 1522637)
2019-02-14 19:20:58 +02:00
Nika Layzell
1b032ecafb Bug 1522637 - Part 7: Perform process switches separtely from on-examine-response, r=valentin
Issues were occuring where a process swap would be decided upon during
on-examine-response, but before the swap could be handled by the
channel, the channel was redirected.

This new code takes the mildly hacky approach of simply using a separate
observer notification which is fired at the correct time. A better
solution may be to use a dedicated service for responding to these
events, however that was not implemented for this initial patch.

Depends on D18607

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

--HG--
extra : moz-landing-system : lando
2019-02-14 15:37:06 +00:00
Valentin Gosu
3d45f28bb0 Bug 1521808 - Implement process switching based on Cross-Opener-Origin-Policy header r=nika,qdot
* New topLevel loads get the nsILoadInfo.openerPolicy of the current top level document
* Parsing the Cross-Opener-Origin-Policy of a channel will update mLoadInfo.openerPolicy and this value will get propagated to the child process.
* SessionStore now checks nsIHttpChannel.hasCrossOriginOpenerPolicyMismatch (preffed off) and performs a process switch if needed

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

--HG--
rename : toolkit/components/remotebrowserutils/tests/browser/browser_httpResponseProcessSelection.js => toolkit/components/remotebrowserutils/tests/browser/browser_httpCrossOriginOpenerPolicy.js
extra : moz-landing-system : lando
2019-02-15 12:14:49 +00:00
Valentin Gosu
27cac83e4a Bug 1521808 - Use topWindowPrincipal for CrossOriginOpenerPolicy check r=mayhemer,nika
- Adds nsIHttpChannelInternal.setTopWindowPrincipal used to pass the principal from the child to the parent

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

--HG--
extra : moz-landing-system : lando
2019-02-15 12:15:21 +00:00
Valentin Gosu
b2a27c32cd Bug 1521808 - Implement Cross-Origin-Opener-Policy header r=nika,mayhemer
Differential Revision: https://phabricator.services.mozilla.com/D18119

--HG--
extra : moz-landing-system : lando
2019-02-15 12:15:39 +00:00
Sylvestre Ledru
41d1d79094 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2019-02-15 08:15:57 +00:00
Andreas Farre
eca9e717dd Bug 1525866 - Add IPDLParamTraits<Tuple<Ts...>>. r=froydnj
Add support for serializing/deserializing tuples.

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

--HG--
extra : moz-landing-system : lando
2019-02-13 16:08:03 +00:00
Andrew McCreight
07e3ce0af7 Bug 1517601, part 3 - WebSocketEvent subclasses should not hold strong references to the channel. r=mayhemer
This patch moves the channel pointer from the WebSocketEvents into the
classes that wrap them (EventTargetDispatcher and
WrappedWebSocketEvent) to fix leaks.

EventTargetDispatcher uses a weak pointer. This is needed to prevent a
leak if the ChannelEvent dispatch fails, because it would create a
cycle of strong references between the WebSocketEvent, the channel,
the channel event queue, and EventTargetDispatcher. It is safe because
the ChannelEventQueue ensures that the channel remains alive.

WrappedWebSocketEvent uses a strong pointer. This won't create a leak
because the runnable is not owned by the channel. It is needed for
safety because it can't rely on the ChannelEventQueue mechanism for
keeping the channel alive.

The WPT whitelisting moves them into two subdirectories that still
seem to leak sometimes, but the top level websockets/ directory seems
okay now.

Depends on D19586

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

--HG--
extra : moz-landing-system : lando
2019-02-13 16:58:31 +00:00
Andrew McCreight
836727fcd1 Bug 1517601, part 2 - Create and use a new WebSocketEvent base class instead of ChannelEvent. r=mayhemer
In the next patch, I want to change the signature of Run(), so I need
to create a new base class for these inner WebSocket events.

For now, this class is the same as ChannelEvent, except that it does
not have the GetEventTarget method, which is never called.

Depends on D19585

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

--HG--
extra : moz-landing-system : lando
2019-02-13 16:57:58 +00:00
Andrew McCreight
d4a4aebf1c Bug 1517601, part 1 - Remove the unused WebSocketChannelChild::DispatchToTargetThread() method. r=mayhemer
Later patches change the WrappedChannelEvent ctor, so I'm removing
this unused method to avoid having to fix it up.

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

--HG--
extra : moz-landing-system : lando
2019-02-13 16:49:26 +00:00
Daniel Varga
1e9aa9e1fc Merge mozilla-central to mozilla-inbound. a=merge on a CLOSED TREE
--HG--
rename : browser/components/nsBrowserContentHandler.js => browser/components/BrowserContentHandler.jsm
2019-02-15 03:51:05 +02:00
Kris Maglione
dfc6aeef42 Backout most of bug 1524687 for Windows PGO xpcshell selftest failures. r=backout 2019-02-14 17:17:36 -08:00
Honza Bambas
c6e223eca9 Bug 1522093 - Make sure to not reuse a connection to a proxy that returns an error response we can't gracefully handle, r=kershaw
Differential Revision: https://phabricator.services.mozilla.com/D19403

--HG--
extra : moz-landing-system : lando
2019-02-12 22:44:30 +00:00
Jonathan Kingston
3421b8fcff Bug 1520868 - Replacing AsyncOpen2 with AsyncOpen always r=valentin
Replacing js and text occurences of asyncOpen2
Replacing open2 with open

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

--HG--
rename : layout/style/test/test_asyncopen2.html => layout/style/test/test_asyncopen.html
extra : moz-landing-system : lando
2019-02-12 16:08:25 +00:00