Граф коммитов

8360 Коммитов

Автор SHA1 Сообщение Дата
Nika Layzell 951525ada7 Bug 1732911 - Hold a PendingDiscard during BrowsingContext::Detach in parent, r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D127483
2021-10-04 21:04:05 +00:00
Peter Van der Beken 0cb68caed4 Bug 1729662 - UNED exam page flickers / reloads infinitely. r=smaug
When we navigate in history to the same entry that we're current at then we
actually do a reload. The problem is in the way we detect whether to do a reload
in the parent process.

If a page does a back and a forward one after the other in a script, then the
parent will calculate the index for the back and tell the child to load the
entry at that index. While the child is processing the load of that entry, the
BC in the parent process still has the same entry as its active entry (until the
child commits the load of the entry over IPC). The parent then processes the
forward, calculates the index for the forward and finds the entry at that index.
This is the same entry that we were at before doing anything, and so the same
entry as the active entry in the BC in the parent process. We used to compare
the entry that we're going to load with the active entry in the BC to determine
whether we're doing a reload, and so in this situation we would assume the
forward navigation was actually doing a reload. The child would reload the page,
and we'd run the script again and we'd end up in a reload loop.

Comparing the offset with 0 to determine whether we're doing a reload fixes this
issue.

Differential Revision: https://phabricator.services.mozilla.com/D126585
2021-10-04 15:01:30 +00:00
Edgar Chen 1e75e43ecc Bug 1733052 - Part 2: Revise popup abuse level if there is a valid transient user activation; r=smaug
This is a intermediate solution to make popup block could work with new user
activation model (timer base). I think this should cover most of async case for
`window.open()`. For long term, we still need to clean up the popup state which
is tracked by bug 1656444.

Differential Revision: https://phabricator.services.mozilla.com/D126879
2021-10-04 09:17:18 +00:00
Alexandru Michis bb8b740837 Backed out changeset d25df1c9e0e2 (bug 1729662) for causing wpt failures in overlapping-navigations-and-traversals
CLOSED TREE
2021-09-30 14:31:50 +03:00
Peter Van der Beken a57818d127 Bug 1729662 - UNED exam page flickers / reloads infinitely. r=smaug
When we navigate in history to the same entry that we're current at then we
actually do a reload. The problem is in the way we detect whether to do a reload
in the parent process.

If a page does a back and a forward one after the other in a script, then the
parent will calculate the index for the back and tell the child to load the
entry at that index. While the child is processing the load of that entry, the
BC in the parent process still has the same entry as its active entry (until the
child commits the load of the entry over IPC). The parent then processes the
forward, calculates the index for the forward and finds the entry at that index.
This is the same entry that we were at before doing anything, and so the same
entry as the active entry in the BC in the parent process. We used to compare
the entry that we're going to load with the active entry in the BC to determine
whether we're doing a reload, and so in this situation we would assume the
forward navigation was actually doing a reload. The child would reload the page,
and we'd run the script again and we'd end up in a reload loop.

Comparing the offset with 0 to determine whether we're doing a reload fixes this
issue.

Differential Revision: https://phabricator.services.mozilla.com/D126585
2021-09-30 07:56:52 +00:00
Nika Layzell 33a743b9b9 Bug 1731792 - Don't switch processes for BFCached same-origin navigations, r=smaug
This is a much simplified patch compared to the earlier changes, and
aims to be less risky and avoid whatever issues are being caused by the
process selection changes in the earlier patches. Unfortunately, I think
this patch may reduce the ability for a noopener window to be given a
distinct process, so I would prefer a more complete fix in the future.

This new patch also no longer has a fix for bug 1728331, so that will
need to be fixed separately.

Differential Revision: https://phabricator.services.mozilla.com/D126951
2021-09-29 19:53:01 +00:00
Olli Pettay 0ca720d7a3 Bug 1725680, requested index should be used only by the nsSHistory (and related code in CanonicalBrowsingContext), r=peterv
Using requestedIndex on the child side is hard, because there are race conditions when a session history load is triggered
and at the same time a non-session history load commits a new active entry.

Differential Revision: https://phabricator.services.mozilla.com/D126619
2021-09-29 13:22:34 +00:00
Olli Pettay 524e95c9e4 Bug 1732250, use the original URI from the old channel when updating session history entry, r=peterv,necko-reviewers,valentin
https://searchfox.org/mozilla-central/rev/1df999af9999ccb436512cfece57a68d94d36e08/netwerk/protocol/http/nsHttpChannel.cpp#2876
makes original uri handling in the channel rather magical. The value of it on the new channel is bogus during
AsyncOnChannelRedirect call, and nsIChannel.idl doesn't hint about that behavior.

browser_getNavigationHistory.js can work as a testcase once it is enabled for Fission.

Differential Revision: https://phabricator.services.mozilla.com/D126735
2021-09-29 09:35:59 +00:00
Iulian Moraru 1bffda0bc3 Backed out changeset a399e91dd5c2 (bug 1729662) for causing wpt failures on cross-document-traversal-cross-document-traversal.html. 2021-09-28 19:14:02 +03:00
Peter Van der Beken ef6256101a Bug 1729662 - UNED exam page flickers / reloads infinitely. r=smaug
When we navigate in history to the same entry that we're current at then we
actually do a reload. The problem is in the way we detect whether to do a reload
in the parent process.

If a page does a back and a forward one after the other in a script, then the
parent will calculate the index for the back and tell the child to load the
entry at that index. While the child is processing the load of that entry, the
BC in the parent process still has the same entry as its active entry (until the
child commits the load of the entry over IPC). The parent then processes the
forward, calculates the index for the forward and finds the entry at that index.
This is the same entry that we were at before doing anything, and so the same
entry as the active entry in the BC in the parent process. We used to compare
the entry that we're going to load with the active entry in the BC to determine
whether we're doing a reload, and so in this situation we would assume the
forward navigation was actually doing a reload. The child would reload the page,
and we'd run the script again and we'd end up in a reload loop.

Comparing the offset with 0 to determine whether we're doing a reload fixes this
issue.

Differential Revision: https://phabricator.services.mozilla.com/D126585
2021-09-28 13:25:15 +00:00
criss 9d7155125b Backed out 2 changesets (bug 1731792) for causing devtools failures on browser_console_error_source_click.js
Backed out changeset 567d4eb7bc83 (bug 1731792)
Backed out changeset db57b8568ae9 (bug 1731792)
2021-09-28 06:15:28 +03:00
Nika Layzell 2793bb97a7 Bug 1731792 - Part 1: Avoid cycling between processes when navigating within a tab, r=smaug
This patch replaces the previous process selection infrastructure with a
new setup implemented entirely in C++, which should more accurately
track the set of processes in use, and should encourage re-use of the
existing content process when navigating by not counting the current
tab.

This approach intentionally allows for process switching to another
process during navigation if there is uneven load between processes to
encourage balanced process use.

I think this may also fix some of the session restore issues with many
tabs using the same process, rather than being spread over 4, as we now
track a tab earlier in its lifecycle before the BrowserParent instance
is created.

Differential Revision: https://phabricator.services.mozilla.com/D126405
2021-09-27 22:34:20 +00:00
Butkovits Atila 24d8b4f45f Backed out 2 changesets (bug 1731792) for causing mochitest failures.
Backed out changeset 44c28a29bbd8 (bug 1731792)
Backed out changeset 51bdb1d4baab (bug 1731792)
2021-09-27 18:54:29 +03:00
Nika Layzell e1a2352d73 Bug 1731792 - Part 1: Avoid cycling between processes when navigating within a tab, r=smaug
This patch replaces the previous process selection infrastructure with a
new setup implemented entirely in C++, which should more accurately
track the set of processes in use, and should encourage re-use of the
existing content process when navigating by not counting the current
tab.

This approach intentionally allows for process switching to another
process during navigation if there is uneven load between processes to
encourage balanced process use.

I think this may also fix some of the session restore issues with many
tabs using the same process, rather than being spread over 4, as we now
track a tab earlier in its lifecycle before the BrowserParent instance
is created.

Differential Revision: https://phabricator.services.mozilla.com/D126405
2021-09-27 13:49:32 +00:00
Nika Layzell 66064a20e9 Bug 1725572 - Part 2: Keep BrowsingContext alive until every process has acknowledged the discard, r=farre
Differential Revision: https://phabricator.services.mozilla.com/D125897
2021-09-23 18:54:31 +00:00
owlishDeveloper 800e6ffa5d Bug 1697866 - Add HTTPS-only specific error code and pass it to GeckoView, to handle HTTPS-only specific errors correctly r=agi,JulianWels,nika,ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D120914
2021-09-23 01:41:47 +00:00
Noemi Erli 50d4e6c878 Backed out changeset 890d147bad1d (bug 1697866) for causing bustages in WindowGlobalParent.cpp CLOSED TREE 2021-09-23 01:20:43 +03:00
owlishDeveloper 7acebc65af Bug 1697866 - Add HTTPS-only specific error code and pass it to GeckoView, to handle HTTPS-only specific errors correctly r=agi,JulianWels,nika,ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D120914
2021-09-22 18:30:39 +00:00
Olli Pettay f083f381d8 Bug 1727514 - media playback should stop in the bfcache, r=peterv
This version doesn't change SetContainer handling, since it seems to be tricky for the top level page.
So only activity change notification is fired and IsActive() is updated.
The comment about IsActive() was wrong even with the old bfcache implementation.
(I did check that it returned false when the page was in bfcache and many of the activity observers rely on that)

The changes to HTMLMediaElement are needed to ensure page can enter bfcache..

Differential Revision: https://phabricator.services.mozilla.com/D124684
2021-09-20 08:49:22 +00:00
Olli Pettay b9336991af Bug 1730977 - Check the existence of requests before calling Stop(), r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D125752
2021-09-17 14:18:20 +00:00
Sandor Molnar 7398f479b5 Merge autoland to mozilla-central. a=merge 2021-09-16 18:58:41 +03:00
Sandor Molnar c60bc752d8 Backed out changeset 2d49d73f38aa (bug 1727514) for causing frequent crashes. a=backout 2021-09-16 15:52:56 +03:00
Valentin Gosu 72c414923b Bug 1730494 - Add error codes for COOP and COEP errors r=necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D125671
2021-09-16 08:31:04 +00:00
Nika Layzell 0c06ba67db Bug 1729458 - Part 2: Make process switches take fewer trips through the event loop, r=smaug
The biggest change in this patch is around the PrepareToChangeRemoteness
promise. It is changed to directly interact with the DOM promise rather than
wrapping it into a MozPromise (which requires another trip through the event
loop), and tries to avoid waiting on the promise at all if it was immediately
resolved (which should always be the case with SHIP enabled, except for in a
single test).

Differential Revision: https://phabricator.services.mozilla.com/D124800
2021-09-14 15:02:58 +00:00
Sandor Molnar 5f8d191513 Backed out 3 changesets (bug 1729458) for causing multiple dt failures. CLOSED TREE
Backed out changeset 16b385e15fad (bug 1729458)
Backed out changeset 72b7a9c7bf30 (bug 1729458)
Backed out changeset 704dd03288b1 (bug 1729458)
2021-09-13 21:08:44 +03:00
Peter Van der Beken 24ff2ec352 Bug 1720990 - Clear mActiveBrowsingContextInContent when a page goes into the BFCache. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D123941
2021-09-13 16:57:15 +00:00
Nika Layzell edec406a72 Bug 1729458 - Part 2: Make process switches take fewer trips through the event loop, r=smaug
The biggest change in this patch is around the PrepareToChangeRemoteness
promise. It is changed to directly interact with the DOM promise rather than
wrapping it into a MozPromise (which requires another trip through the event
loop), and tries to avoid waiting on the promise at all if it was immediately
resolved (which should always be the case with SHIP enabled, except for in a
single test).

Differential Revision: https://phabricator.services.mozilla.com/D124800
2021-09-13 15:23:32 +00:00
Olli Pettay d0485c8a55 Bug 1727514 - media playback should stop in the bfcache, r=peterv
SetContainer handling is similar to what DocumentViewer does for the old bfcache implementation.
(The old implementation hides it quite well).
The changes to HTMLMediaElement are needed to ensure page can enter bfcache.

Removed erroneous MOZ_ASSERT in nsPresContext, it is ok to trigger that code path in the new implementation.
And the Run() method of the relevant nsIRunnable already deals with that case.

Differential Revision: https://phabricator.services.mozilla.com/D124684
2021-09-13 12:40:18 +00:00
Peter Van der Beken 42d3aca4dc Bug 1728413 - mistik.xtr.jp doesn't load. r=smaug
Getting all the requests from the loadgroup every time a request
is added or removed was causing performance issues. It turns out
that it wasn't really needed for determining if a page should be
blocked from the BFCache, since we just need to know if there
are any requests in the loadgroup, and if so, if all it contains
is just one request with an id. We can keep a count of relevant
requests in the loadgroup. When the count changes to 1, on adding
we can inspect the request that's being added, and on removal we
can inspect the requests in the loadgroup (which should be now be
cheap enough, since there's only 1 relevant request in the list).

Differential Revision: https://phabricator.services.mozilla.com/D125251
2021-09-13 12:35:31 +00:00
Michelle Goossens d835eb1793 Bug 1727925 - Part 3: Migrate six more windows10-32 test suites from AWS to Azure r=jmaher
Differential Revision: https://phabricator.services.mozilla.com/D124192
2021-09-10 11:51:00 +00:00
Benjamin Peterson 9253af4014 Bug 1729843 - Remove vestigial plugin-related code from nsWebNavigationInfo. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D125026
2021-09-09 15:03:05 +00:00
Alexandru Michis 957058da9c Backed out 2 changesets (bug 1729458) for causing leaks in ClientManagerService.
CLOSED TREE

Backed out changeset 42b3a9930fe0 (bug 1729458)
Backed out changeset b8db01010657 (bug 1729458)
2021-09-08 21:32:20 +03:00
Nika Layzell 336e7e2365 Bug 1729458 - Part 2: Make process switches take fewer trips through the event loop, r=smaug
The biggest change in this patch is around the PrepareToChangeRemoteness
promise. It is changed to directly interact with the DOM promise rather than
wrapping it into a MozPromise (which requires another trip through the event
loop), and tries to avoid waiting on the promise at all if it was immediately
resolved (which should always be the case with SHIP enabled, except for in a
single test).

Differential Revision: https://phabricator.services.mozilla.com/D124800
2021-09-08 17:06:16 +00:00
Marian-Vasile Laza 62d525db78 Backed out changeset 9bc536ff95be (bug 1720990) for causing bc failures on browser_bfcache_copycommand.js. CLOSED TREE 2021-09-07 12:52:54 +03:00
Peter Van der Beken 1887defe4a Bug 1720990 - Clear mActiveBrowsingContextInContent when a page goes into the BFCache. r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D123941
2021-09-07 08:49:26 +00:00
Florian Quèze 998adb18ea Bug 1728760 - require all nsITimerCallback native implementations to also implement nsINamed, r=smaug.
Differential Revision: https://phabricator.services.mozilla.com/D124349
2021-09-07 08:01:18 +00:00
Nika Layzell 8bd29055b8 Bug 1725572 - Wait for parent ack when discarding BC from child, r=kmag
I am not confident that this will fix the underlying issue causing this crash,
but given how small of a change it is, I figure it's worth trying to land
quickly to see if the crash rate drops with it.

Differential Revision: https://phabricator.services.mozilla.com/D124503
2021-09-03 22:21:49 +00:00
Nika Layzell c525c65ff8 Bug 1722880 - Part 1: Add IsInBFCache to WindowContext, and make it non-SHIP compatible, r=smaug,necko-reviewers,dragana
This field will be useful to JS code such as JSWindowActors which need to be
able to detect when their WindowContext is no longer active.

Differential Revision: https://phabricator.services.mozilla.com/D124098
2021-09-03 15:26:13 +00:00
Mike Conley ab45276a8f Bug 1728375 - Notify session history listeners when entries are being removed via purging or truncation. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D124101
2021-09-02 15:33:16 +00:00
Nika Layzell 4b55141036 Bug 1728605 - Part 3: Rename IsFrame to IsSubframe, r=smaug
This makes the method's name more consistent with IsContentSubframe, and is
probably more clear than IsFrame (as a <browser> could be considered a frame).

Depends on D124211

Differential Revision: https://phabricator.services.mozilla.com/D124212
2021-09-02 14:15:04 +00:00
Nika Layzell b40ab34831 Bug 1728605 - Part 2: Rename misleading {Window,Browsing}Context::IsCached, r=smaug
This method actually tracks whether the context is current, so it has been
renamed, and the behaviour has been inverted.

Depends on D124210

Differential Revision: https://phabricator.services.mozilla.com/D124211
2021-09-02 14:15:04 +00:00
Nika Layzell b123cca8a7 Bug 1728605 - Part 1: Add assertions to various non-SHIP codepaths, r=smaug
These codepaths will never be taken with SHIP enabled, and this patch adds a
couple assertions to keep track of that information for when we rip out SHIP.

Differential Revision: https://phabricator.services.mozilla.com/D124210
2021-09-02 14:15:03 +00:00
Timothy Nikkel 6e65573ea5 Bug 1728665. Use IsRootContentDocumentCrossProcess for a few places dealing with visual scroll offsets. r=botond
Visual scroll offsets can only differ on the cross process root content document.

Differential Revision: https://phabricator.services.mozilla.com/D124257
2021-09-01 23:25:44 +00:00
Olli Pettay 4d366e1861 Bug 1723282, let nonbfcacheable page update layout history state when the new page is coming from the bfcache, r=peterv
The fix let's ContentParent::RecvSynchronizeLayoutHistoryState update the layout history state.

Using an existing test to launch a subtest for this. Hopefully the description of the test helps with reviewing it.
(These BroadcastChannel based tests can be hard to follow.)

Differential Revision: https://phabricator.services.mozilla.com/D122376
2021-08-30 19:50:05 +00:00
Olli Pettay 1c1c20f331 Bug 1670973, add a test to check how http redirects affect to the session history, r=peterv
The old implementation and SHIP seem to have the same behavior.

Differential Revision: https://phabricator.services.mozilla.com/D123117
2021-08-30 19:33:52 +00:00
Henri Sivonen 58e0b2946c Bug 1716290 - Remove protections against the document changing as part of kCharsetFromFinalUserForcedAutoDetection reload. r=emk,emilio
NOTE! In cases where there is no HTTP-layer encoding declaration, and CSS
parsing inherits the encoding from the HTML document, for preloads, this
changes the inherited encoding from windows-1252 to UTF-8 in order to
make the speculative encoding correct in the common `<meta charset=utf-8>`
case.

Differential Revision: https://phabricator.services.mozilla.com/D123593
2021-08-26 18:02:15 +00:00
Nika Layzell c38d0d1762 Bug 1726865 - Prefer using existing content processes for subframes during process selection, r=farre
Differential Revision: https://phabricator.services.mozilla.com/D123661
2021-08-26 16:57:27 +00:00
criss 2be42eea15 Backed out changeset ab805f2926d5 (bug 1716290) for causing failures on link-header-preload.html. CLOSED TREE 2021-08-26 12:07:17 +03:00
Henri Sivonen ff85d45e69 Bug 1716290 - Remove protections against the document changing as part of kCharsetFromFinalUserForcedAutoDetection reload. r=emk
Differential Revision: https://phabricator.services.mozilla.com/D123593
2021-08-26 06:25:31 +00:00
Mark Banner f3ee19dbc7 Bug 1727591 - Enable remaining ESLint rule on remaining docshell/ xhtml files. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D123657
2021-08-25 18:42:19 +00:00