Commit Graph

3154 Commits

Author SHA1 Message Date
Dimi Lee
d59145948e Bug 1601310 - Add GetContentBlockingEvents IPC method for the child to retrive content blocking event in the parent. r=timhuang,twisniewski,Ehsan
This patch does the following:
1. Add a WindowGlobalChild IPC method - GetContentBlockingEvents. Documents can use the method
   retrieve content blocking events stored in the parent process.
2. Update nsIDocShell::GetHasTrackingContentBlocked to return a promise.
3. Replace API in report-site-issue to use the promise-based GetHasTrackingContentBlocked API

Differential Revision: https://phabricator.services.mozilla.com/D56204
2019-12-17 11:05:06 +00:00
Matt Woodrow
f3883f930b Bug 1599438 - Store sandbox flags on the LoadInfo when creating a channel for a docshell, so that we don't read a stale value from the BrowsingContext later. r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D59263
2020-01-15 08:02:57 +00:00
Narcis Beleuzu
bf2b2d612d Backed out changeset b3538b7016aa (bug 1599438) for bustages on TestHttpFuzzing.cpp . CLOSED TREE 2020-01-15 06:03:55 +02:00
Narcis Beleuzu
4723d54743 Backed out changeset ea7d48958f2f (bug 1594280) for mochitest failures on nsDocShell.cpp . CLOSED TREE 2020-01-15 05:50:28 +02:00
Matt Woodrow
5f6fd6d997 Bug 1599438 - Store sandbox flags on the LoadInfo when creating a channel for a docshell, so that we don't read a stale value from the BrowsingContext later. r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D59263
2020-01-15 02:05:57 +00:00
Tetsuharu OHZEKI
abbe92b5c8 Bug 1594280 - Fix uses of nsIDocShellTreeItem in nsIDocShellTreeItem in nsDocShell::ValidateOrigin. r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D58447
2020-01-14 21:03:52 +00:00
Matt Woodrow
9ea8c6570f Bug 1607987 - Split DocumentChannelChild into two classes. r=jya
This shouldn't have any functional changes, and adds some new comments to explain the purpose of the classes a bit better.

Differential Revision: https://phabricator.services.mozilla.com/D59265
2020-01-13 00:28:13 +00:00
Ciure Andrei
c6f59c79e3 Backed out changeset ca6f43c06131 (bug 1607987) for causing test_bug369370.html to permafail 2020-01-13 04:10:57 +02:00
Matt Woodrow
cf1f801e8b Bug 1607987 - Split DocumentChannelChild into two classes. r=jya
This shouldn't have any functional changes, and adds some new comments to explain the purpose of the classes a bit better.

Differential Revision: https://phabricator.services.mozilla.com/D59265
2020-01-13 00:28:13 +00:00
Johann Hofmann
282e012e20 Bug 353933 - Make OnOverlink use CreateExposableURI. r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D59428
2020-01-10 12:45:38 +00:00
Matt Woodrow
86c525d4e7 Bug 1598523 - Enable DocumentChannel for view-source. r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D57894
2020-01-08 01:00:43 +00:00
Matt Woodrow
452cbf7077 Bug 1598523 - Share code for creating a channel for a document between nsDocShell, DocumentChannelChild and ContentChild. r=kmag
Note that this also implicitly adds support for the view-source+srcdoc configuration, and setting of the BaseURI, which were both in the nsDocShell version but not the others.

Differential Revision: https://phabricator.services.mozilla.com/D57887
2020-01-08 02:10:54 +00:00
Bogdan Tara
191d90bec0 Backed out 6 changesets (bug 1598523) for geckoview failures complaining about NavigationDelegateTest.loadUnknownProtocol
Backed out changeset 2e7ea1ae7fa2 (bug 1598523)
Backed out changeset 6adc1062662b (bug 1598523)
Backed out changeset 141372c43f02 (bug 1598523)
Backed out changeset c5abcaabaf2d (bug 1598523)
Backed out changeset 5a22a20dd993 (bug 1598523)
Backed out changeset e0df103c9cf3 (bug 1598523)
2020-01-08 02:56:18 +02:00
Matt Woodrow
3d34bed9be Bug 1598523 - Enable DocumentChannel for view-source. r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D57894
2020-01-07 20:58:20 +00:00
Matt Woodrow
40b9b10577 Bug 1598523 - Share code for creating a channel for a document between nsDocShell, DocumentChannelChild and ContentChild. r=kmag
Note that this also implicitly adds support for the view-source+srcdoc configuration, and setting of the BaseURI, which were both in the nsDocShell version but not the others.

Differential Revision: https://phabricator.services.mozilla.com/D57887
2020-01-07 21:17:22 +00:00
Tetsuharu OHZEKI
b4b7ece113 Bug 1575326 - Fix usage of nsIDocShellTreeItem in nsDocShell::SetIsActive. r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D58443
2020-01-07 08:08:49 +00:00
Tetsuharu OHZEKI
37027fc3a2 bug 1575328 - Fix usage of nsIDocShellTreeItem in nsDocShell::SetMixedContentChannel. r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D58442
2020-01-07 08:16:26 +00:00
Matt Woodrow
e2a14477d6 Bug 1598520 - Allow DocumentChannel for srcdoc= loads. r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D57587
2020-01-06 21:36:34 +00:00
Matt Woodrow
8b1b33cac0 Bug 1598520 - Don't require nsIChildChannel for process switching, as we don't need this for DocumentChannel either. r=mayhemer,kmag
Differential Revision: https://phabricator.services.mozilla.com/D57586
2020-01-06 21:58:48 +00:00
Tetsuharu OHZEKI
423370c334 Bug 1606528 - part 2: Replace idioms with BrowsingContext::IsTop(). r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D58481
2020-01-06 19:13:38 +00:00
Jean-Yves Avenard
e17a2ef796 Bug 1607068 - Don't assert that the timing object isn't set for about:blank load. r=mattwoodrow
about:blank gets loaded into the new docshell before ResumeRedirectedLoad get called for the 'real' load
Under some circumstances, it is sometimes possible that we got far enough with the about:blank load to initialize a timing.
Under these conditions, it is safe to disregard the existing timing information and replace it with the one carried over.

Differential Revision: https://phabricator.services.mozilla.com/D58733
2020-01-06 02:47:42 +00:00
Emilio Cobos Álvarez
07b0dcbdab Bug 1606659 - Don't pass margin and scrollbar preferences to nsFrameLoader::Show. r=mattwoodrow
Instead, get them on the relevant code paths.

Differential Revision: https://phabricator.services.mozilla.com/D58534
2020-01-05 22:48:40 +00:00
Jean-Yves Avenard
28a15c589a Bug 1603187 - P4. Pass navigation timing info to the new docshell when performing a process switch. r=mattwoodrow,farre
Differential Revision: https://phabricator.services.mozilla.com/D57772
2020-01-05 05:44:44 +00:00
Boris Zbarsky
515db023b7 Fix mis-pasted comment. No bug,
Differential Revision: https://phabricator.services.mozilla.com/D58158
2019-12-23 20:38:20 +00:00
Chris Peterson
0a9155f83b Bug 1570499 - Part 1: Replace MOZ_FALLTHROUGH macro with C++17's [[fallthrough]] attribute. r=froydnj
This changeset is a simple find and replace of `MOZ_FALLTHROUGH` and `[[fallthrough]]`.

Unfortunately, the MOZ_FALLTHROUGH_ASSERT macro (to assert on case fallthrough in debug builds) is still necessary after switching from [[clang::fallthrough]] to [[fallthrough]] because:

* MOZ_ASSERT(false) followed by [[fallthrough]] triggers a -Wunreachable-code warning in DEBUG builds
* but MOZ_ASSERT(false) without [[fallthrough]] triggers a -Wimplicit-fallthrough warning in NDEBUG builds.

Differential Revision: https://phabricator.services.mozilla.com/D56440
2019-12-20 07:16:43 +00:00
Razvan Maries
29d98a3d41 Backed out 5 changesets (bug 1598520) for perma fails on test_enumerateDevices_navigation.html. CLOSED TREE
Backed out changeset 583dac2feebc (bug 1598520)
Backed out changeset c769e733f588 (bug 1598520)
Backed out changeset 45287a2ec476 (bug 1598520)
Backed out changeset 59cff6014447 (bug 1598520)
Backed out changeset ddf722557c33 (bug 1598520)
2019-12-20 01:56:55 +02:00
Matt Woodrow
b62e743375 Bug 1598520 - Allow DocumentChannel for srcdoc= loads. r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D57587
2019-12-19 21:48:00 +00:00
Matt Woodrow
531027b22b Bug 1598520 - Don't require nsIChildChannel for process switching, as we don't need this for DocumentChannel either. r=mayhemer,kmag
Differential Revision: https://phabricator.services.mozilla.com/D57586
2019-12-19 21:47:10 +00:00
Razvan Maries
601e71c3cb Backed out 5 changesets (bug 1598520) for Linting failure. CLOSED TREE
Backed out changeset b4f71abf75fe (bug 1598520)
Backed out changeset 8e3b650d9313 (bug 1598520)
Backed out changeset 73c37ad27d18 (bug 1598520)
Backed out changeset 10ad2e4d27c3 (bug 1598520)
Backed out changeset 4a5d10759bf3 (bug 1598520)
2019-12-20 00:38:32 +02:00
Matt Woodrow
7bfadab242 Bug 1598520 - Allow DocumentChannel for srcdoc= loads. r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D57587
2019-12-19 21:48:00 +00:00
Matt Woodrow
a773e1515d Bug 1598520 - Don't require nsIChildChannel for process switching, as we don't need this for DocumentChannel either. r=mayhemer,kmag
Differential Revision: https://phabricator.services.mozilla.com/D57586
2019-12-19 21:47:10 +00:00
Kris Maglione
b709d4b8cc Bug 1588259: Part 2 - Prevent URI loads in partially-initialized BrowsingContexts. r=smaug
When we open a new window from a content process, we create a nested event
loop to wait for it to be initialized by the parent. The problem with this is
that the OpenWindow code which calls the window provider expects the window to
be in-process and uninitialized, so that it can load its own initial URI into
it, and correctly fulfil the spec-codified contract of window.open(). If
another caller initiates a load in the new window during the nested event
loop, those invariants are broken, and any manner of undefined behavior can
occur.

This patch adds a new flag to the BrowsingContext, marking it as uninitialized
until the end of the nested event loop, and blocking any attempts to load a
new URI into it in the meantime.

Differential Revision: https://phabricator.services.mozilla.com/D57667
2019-12-19 22:05:19 +00:00
Razvan Maries
8e52fd1919 Backed out 2 changesets (bug 1588259) for perma fais on 1588259.html. CLOSED TREE
Backed out changeset 62fb499df45a (bug 1588259)
Backed out changeset 34716f07e8cb (bug 1588259)
2019-12-19 23:34:57 +02:00
Tetsuharu OHZEKI
fd7dc2a06a Bug 1574280 - Fix usage of nsIDocShellTreeItem in nsDocShell::SetCurrentURI. r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D57608
2019-12-19 20:01:14 +00:00
Kris Maglione
8fdd007e40 Bug 1588259: Part 2 - Prevent URI loads in partially-initialized BrowsingContexts. r=smaug
When we open a new window from a content process, we create a nested event
loop to wait for it to be initialized by the parent. The problem with this is
that the OpenWindow code which calls the window provider expects the window to
be in-process and uninitialized, so that it can load its own initial URI into
it, and correctly fulfil the spec-codified contract of window.open(). If
another caller initiates a load in the new window during the nested event
loop, those invariants are broken, and any manner of undefined behavior can
occur.

This patch adds a new flag to the BrowsingContext, marking it as uninitialized
until the end of the nested event loop, and blocking any attempts to load a
new URI into it in the meantime.

Differential Revision: https://phabricator.services.mozilla.com/D57667
2019-12-19 19:53:24 +00:00
Tetsuharu OHZEKI
d7c1afee1f Bug 1596820 - part 2: Remove use of nsIDocShellTreeItem in nsDocShellLoadState::SetupInheritingPrincipal. r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D57323
2019-12-18 18:49:05 +00:00
Tetsuharu OHZEKI
7506d96ea9 Bug 1579988 - Fix usage of nsIDocShellTreeItem in nsDocShell::SetTitle. r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D57280
2019-12-18 19:04:22 +00:00
Matt Woodrow
87106b7437 Bug 1574372 - Add parent-process version of nsDocumentOpenInfo, and use it in DocumentLoadListener. r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D56137
2019-12-17 03:54:45 +00:00
Matt Woodrow
364f927195 Bug 1574372 - Allow using nsWebNavigationInfo statically. r=bzbarsky
IsTypeSupported requires a docshell in order to determine if plugins are allowed. This adds a static version that lets the caller provide their own value for allowing plugins.

Differential Revision: https://phabricator.services.mozilla.com/D56132
2019-12-17 03:01:37 +00:00
Oana Pop Rus
55429b1216 Backed out 9 changesets (bug 1574372) for bustage and wpt failures. on a CLOSED TREE
Backed out changeset b0183a606fec (bug 1574372)
Backed out changeset b7c96254826e (bug 1574372)
Backed out changeset 196d61adc272 (bug 1574372)
Backed out changeset 419b94b1210e (bug 1574372)
Backed out changeset c192e499eb47 (bug 1574372)
Backed out changeset 4e57038c3518 (bug 1574372)
Backed out changeset 6ec2aa542b59 (bug 1574372)
Backed out changeset d71b4c0aac1a (bug 1574372)
Backed out changeset a05c3b113ac1 (bug 1574372)
2019-12-17 03:26:38 +02:00
Matt Woodrow
28378eb5fe Bug 1574372 - Add parent-process version of nsDocumentOpenInfo, and use it in DocumentLoadListener. r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D56137
2019-12-16 21:26:01 +00:00
Matt Woodrow
54948e07eb Bug 1574372 - Allow using nsWebNavigationInfo statically. r=bzbarsky
IsTypeSupported requires a docshell in order to determine if plugins are allowed. This adds a static version that lets the caller provide their own value for allowing plugins.

Differential Revision: https://phabricator.services.mozilla.com/D56132
2019-12-16 21:25:17 +00:00
Matt Woodrow
38dd6f0b54 Bug 1590422 - Show error page for unknown protocols. r=kmag
Before DocumentChannel, unknown protocol errors happened when we tried to create the channel, so didn't go through this path. With DocumentChannel we don't find out until we're in the parent process, so they come through as a failed request value, which encounters these filters.

Depends on D56841

Differential Revision: https://phabricator.services.mozilla.com/D57030
2019-12-16 00:19:03 +00:00
Tom Schuster
620c383d5f Bug 1594284 - Remove nsDocShell::CanAccessItem. r=annyG
Apparently Bug 1594288 removed the user of this function.

Differential Revision: https://phabricator.services.mozilla.com/D57226
2019-12-16 17:15:37 +00:00
Emilio Cobos Álvarez
3a412cb3ee Bug 1603889 - Simplify the scrollbar preference setup. r=smaug
So much plumbing to pass an enum down.

Differential Revision: https://phabricator.services.mozilla.com/D57182
2019-12-15 22:56:23 +00:00
Boris Zbarsky
8f97398a08 Bug 1602483 part 2. Add a window id argument to CheckLoadURIWithPrincipal. r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D56428
2019-12-12 16:41:19 +00:00
Boris Zbarsky
bf2401beec Bug 1602483 part 1. Add a window id argument to SetupRefreshURIFromHeader. r=ckerschb
We can use this for error reporting.

Differential Revision: https://phabricator.services.mozilla.com/D56427
2019-12-12 16:41:21 +00:00
Boris Zbarsky
fcb04b87e4 Bug 1602090 part 2. Create separate CheckMayLoad and CheckMayLoadWithReporting APIs. r=ckerschb
CheckMayLoadAndReport takes a window ID.  This allows us to report
errors from it to the web console as needed.  Most consumers know statically
whether they want reporting or not, so there's no reason to force the ones that
don't to provide window ids.

Differential Revision: https://phabricator.services.mozilla.com/D56388
2019-12-13 06:24:12 +00:00
Kris Maglione
41a5f0e588 Bug 1588220: Keep track of last active inner window when BrowsingContext is discarded. r=bzbarsky
Any number of outer windows may be attached to a BrowsingContext over its
lifetime. While the BrowsingContext is alive, it's easy to keep track of which
of these is active, and therefore which of its inner windows is active. After
it has been discarded, though, it discards its docShell reference, so all we
can tell about an inner window is whether it is active for its own outer
window, but not whether it should be considered active for its
BrowsingContext.

This patch updates the BrowsingContext detach logic to store a flag on the
current inner window recording that it was active when its BrowsingContext was
detached, and then later checks that flag to determine if it is the current
window for a detached BrowsingContext.

Differential Revision: https://phabricator.services.mozilla.com/D49032
2019-12-12 23:11:01 +00:00
Henri Sivonen
b33e8e6eaf Bug 1551276 - Autodetect legacy encodings on unlabeled pages. r=emk
Differential Revision: https://phabricator.services.mozilla.com/D56362
2019-12-12 17:50:19 +00:00