Commit Graph

3124 Commits

Author SHA1 Message Date
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
Ciure Andrei
2e0157c747 Backed out 4 changesets (bug 1602483, bug 1602090) for causing perma leackchecks CLOSED TREE
Backed out changeset 6b057ba06b4a (bug 1602483)
Backed out changeset 9be3269d781d (bug 1602483)
Backed out changeset e3e2c1d7478e (bug 1602090)
Backed out changeset fdc4a588912e (bug 1602090)
2019-12-12 18:37:01 +02:00
Andreas Farre
f6b213192a Bug 1561715 - Part 1: Remove unused functionality in SchedulerGroup. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D55638
2019-12-11 14:48:41 +00:00
Oana Pop Rus
53a8a406db Backed out changeset 0810ad586986 (bug 1551276) for wpt failures in ar-ISO-8859-6-late.tentative.html on a CLOSED TREE 2019-12-12 16:38:54 +02:00
Boris Zbarsky
f99de7f9a0 Bug 1602483 part 2. Add a window id argument to CheckLoadURIWithPrincipal. r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D56428
2019-12-12 13:05:12 +00:00
Boris Zbarsky
94bba88e67 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 13:03:56 +00:00
Boris Zbarsky
d9b66ffabd 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-12 13:03:42 +00:00
Andreas Farre
7e4d754e73 Bug 1594288 - Remove nsIDocShellTreeItem.findChildWithName. r=annyG
Differential Revision: https://phabricator.services.mozilla.com/D55977
2019-12-12 13:29:39 +00:00
Henri Sivonen
5404be1b75 Bug 1551276 - Autodetect legacy encodings on unlabeled pages. r=emk
Differential Revision: https://phabricator.services.mozilla.com/D56362
2019-12-12 12:59:47 +00:00
Matt Woodrow
ecfe4c769f Bug 1603194 - Pass nsDocShellLoadState's load flags to new process when process switching. r=kmag
Depends on D56821

Differential Revision: https://phabricator.services.mozilla.com/D56822
2019-12-12 02:32:29 +00:00
Oana Pop Rus
106bfb23cb Backed out changeset 0e82a2a87b39 (bug 1594288) for causing build bustages in nsDocShell.cpp on a CLOSED TREE 2019-12-11 17:08:33 +02:00
Andreas Farre
a41f9d2620 Bug 1594288 - Remove nsIDocShellTreeItem.findChildWithName. r=annyG
There are no callers of findChildWithName after it got replaced by
corresponding methods in BrowsingContext.

Differential Revision: https://phabricator.services.mozilla.com/D55977
2019-12-06 19:05:52 +00:00
Yaron Tausky
d902a7d422 Bug 1593246 - Part 1: Move SessionStorageManager to BrowsingContext r=dom-workers-and-storage-reviewers,sg,smaug
With Fission enabled we do not necessarily have access to the
nsDocShell that holds the top-level browsing context, so the
BrowsingContext is a better place to store information that needs
to be accessible to nested browsing contexts.

Differential Revision: https://phabricator.services.mozilla.com/D55276
2019-12-10 12:12:25 +00:00
Emilio Cobos Álvarez
c2c776c612 Bug 1601563 - Don't set history title for subframes. r=mak
This doesn't affect GeckoView history per:

  https://searchfox.org/mozilla-central/rev/ea63a0888d406fae720cf24f4727d87569a8cab5/mobile/android/components/geckoview/GeckoViewHistory.cpp#348

So whether GeckoView does this is a different question.

Depends on D56213

Differential Revision: https://phabricator.services.mozilla.com/D56214
2019-12-09 22:39:55 +00:00
Kannan Vijayan
d68d8d22c1 Bug 1580241 - Fix usage of nsIDocShellTreeItem in nsDocShell::CanSavePresentation r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D56003
2019-12-06 19:30:49 +00:00
Razvan Maries
3aec015044 Backed out 3 changesets (bug 1593246) for build bustages on BrowsingContext.h. CLOSED TREE
Backed out changeset fd389138a684 (bug 1593246)
Backed out changeset 2663311a1b62 (bug 1593246)
Backed out changeset d9f0d827e28d (bug 1593246)
2019-12-09 20:32:18 +02:00
Yaron Tausky
af3113e2f9 Bug 1593246 - Part 1: Move SessionStorageManager to BrowsingContext r=dom-workers-and-storage-reviewers,sg,smaug
With Fission enabled we do not necessarily have access to the
nsDocShell that holds the top-level browsing context, so the
BrowsingContext is a better place to store information that needs
to be accessible to nested browsing contexts.

Differential Revision: https://phabricator.services.mozilla.com/D55276
2019-12-09 13:04:51 +00:00
Gabriele Svelto
eeb9bfc398 Bug 1600545 - Remove useless inclusions of header files generated from IDL files in accessible/, browser/, caps/, chrome/, devtools/, docshell/, editor/, extensions/, gfx/, hal/, image/, intl/, ipc/, js/, layout/, and media/ r=Ehsan
The inclusions were removed with the following very crude script and the
resulting breakage was fixed up by hand. The manual fixups did either
revert the changes done by the script, replace a generic header with a more
specific one or replace a header with a forward declaration.

find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do
    interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2)
    if [ -n "$interfaces" ]; then
        if [[ "$interfaces" == *$'\n'* ]]; then
          regexp="\("
          for i in $interfaces; do regexp="$regexp$i\|"; done
          regexp="${regexp%%\\\|}\)"
        else
          regexp="$interfaces"
        fi
        interface=$(basename "$path")
        rg -l "#include.*${interface%%.idl}.h" . | while read path2; do
            hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" )
            if [ $hits -eq 0 ]; then
                echo "Removing ${interface} from ${path2}"
                grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp
                mv -f "$path2".tmp "$path2"
            fi
        done
    fi
done

Differential Revision: https://phabricator.services.mozilla.com/D55443
2019-12-06 09:16:44 +00:00
Olli Pettay
c96e061efc Bug 1596958 - Synchronize layouthistorystate to parent process, r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D53288
2019-12-05 20:30:45 +00:00
Mark Striemer
4762ab815c Bug 1565606 - Remove remote disco pane support from nsDocShell.cpp r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D55720
2019-12-05 18:32:39 +00:00
Brindusan Cristian
571f63a42b Backed out changeset 69ac0bf82505 (bug 1596958) for assertion failures at nsSHEntry.cpp. CLOSED TREE 2019-12-05 21:01:02 +02:00
Olli Pettay
5387a9b735 Bug 1596958 - Synchronize layouthistorystate to parent process, r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D53288
2019-12-05 17:33:48 +00:00
Masatoshi Kimura
4bfa0ac097 Bug 1455716 - Followup to fix review comments. r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D55881
2019-12-05 10:36:12 +00:00
Boris Zbarsky
2df1df0176 Bug 1517588. Use nsIPrincipal::IsSystemPrincipal instead of nsContentUtils::IsSystemPrincipal r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D53067
2019-12-05 04:44:32 +00:00
Masatoshi Kimura
1c4a66ae16 Bug 1455716 - Simplify/rename nsIWebBrowserChrome;setStatus and setStatusWithContext. r=bzbarsky
* Removed the STATUS_LINK constant.
* Removed the statusType parameter from nsIWebBrowserChrome::setStatus.
* Removed the setStatusWithContext method. No one uses the information from
  statusContext.
* Removed the nsIWebBrowserChrome2 interface as setStatusWithContext was the
  only method.

Differential Revision: https://phabricator.services.mozilla.com/D55195
2019-12-04 13:50:01 +00:00
Matt Woodrow
349a2975b6 Bug 1598516 - Handle malformed uri load error with an error page. r=kmag
Previously this error occurred synchronously during AsyncOpen, and we handled it there.
With DocumentChannel we don't find out until it's handled in the parent, so the error is returned to the docshell via a failed status on the request.

Differential Revision: https://phabricator.services.mozilla.com/D54248
2019-12-03 23:54:33 +00:00
Matt Woodrow
cdddf2f21e Bug 1598516 - Enable DocumentChannel for all protocols, except for list of known issues. r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D54246
2019-12-03 23:54:08 +00:00
Bogdan Tara
6e905df32f Backed out 8 changesets (bug 1598516) for run startup hangs CLOSED TREE
Backed out changeset bc0035aa57fe (bug 1598516)
Backed out changeset 33603b723337 (bug 1598516)
Backed out changeset 31c11dd9146d (bug 1598516)
Backed out changeset 4e269a638350 (bug 1598516)
Backed out changeset 76b86080c868 (bug 1598516)
Backed out changeset b6f84b01cbd9 (bug 1598516)
Backed out changeset 74d136798dd3 (bug 1598516)
Backed out changeset bf370938463e (bug 1598516)
2019-12-04 00:48:17 +02:00
Matt Woodrow
fbcbea9265 Bug 1598516 - Handle malformed uri load error with an error page. r=kmag
Previously this error occurred synchronously during AsyncOpen, and we handled it there.
With DocumentChannel we don't find out until it's handled in the parent, so the error is returned to the docshell via a failed status on the request.

Differential Revision: https://phabricator.services.mozilla.com/D54248
2019-12-03 20:43:24 +00:00
Matt Woodrow
8fc22f4047 Bug 1598516 - Enable DocumentChannel for all protocols, except for list of known issues. r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D54246
2019-12-03 20:43:17 +00:00
Gurzau Raul
068af7717a Backed out 8 changesets (bug 1598516) for build bustage at ParentChannelListener.cpp on a CLOSED TREE.
Backed out changeset 7ac1b091aa5f (bug 1598516)
Backed out changeset b62c5b49b91c (bug 1598516)
Backed out changeset e48c0ce38498 (bug 1598516)
Backed out changeset cc2599921b5e (bug 1598516)
Backed out changeset 0a0f80b0b278 (bug 1598516)
Backed out changeset 1dc19a039cab (bug 1598516)
Backed out changeset b664c8af6e2d (bug 1598516)
Backed out changeset 943b440179b9 (bug 1598516)
2019-12-03 21:48:14 +02:00