Commit Graph

629 Commits

Author SHA1 Message Date
Butkovits Atila
80c415a4fc Backed out 4 changesets (bug 1702055) for causing failures on /browser_UsageTelemetry_private_and_restore.js. CLOSED TREE
Backed out changeset af21e2d8324e (bug 1702055)
Backed out changeset ff67df9befe5 (bug 1702055)
Backed out changeset b5f0638dcbc4 (bug 1702055)
Backed out changeset bffaa2c203b3 (bug 1702055)
2021-04-28 04:42:09 +03:00
Kashav Madan
ed25699760 Bug 1702055 - Only call setInitialTabTitle() if the label hasn't yet been set, r=nika
With the new "restore docshell state" codepath, we may be calling
updateTabLabelAndIcon() later than we did before, which means we may have
already set the tab label (in tabbrowser.init()), and it's incorrect to override
that label value with the session history entry's title.

Differential Revision: https://phabricator.services.mozilla.com/D111456
2021-04-27 19:54:58 +00:00
Kashav Madan
5032f65750 Bug 1702055 - Move the "restore DocShell state" process out of ContentSessionStore.jsm, r=nika
This also makes it so that we will never fire SSTabRestored without first having
sent the associated SSTabRestoring event.

Differential Revision: https://phabricator.services.mozilla.com/D110335
2021-04-27 19:54:57 +00:00
Kashav Madan
f163b81676 Bug 1702055 - Ensure that ContentSessionStore's epoch is updated for tab flushes, r=nika
With the removal of the SessionStore:RestoreDocShellState message, the epoch
will no longer be updated otherwise, so we should include it in the Flush
message to ensure that messages are not being dropped.

Differential Revision: https://phabricator.services.mozilla.com/D110334
2021-04-27 19:54:57 +00:00
Kashav Madan
079d321f9d Bug 1702055 - Replace CallRestoreTabContentComplete with a Promise, r=nika
This should help avoid message ordering issues in the next patches. To ensure
that we're not firing events too early, we now do a "full" restore even if we
don't have form or scroll data, including for about:blank URIs.

This also moves all restore state on the CanonicalBrowsingContext into a
separate `mRestoreState` struct.

Differential Revision: https://phabricator.services.mozilla.com/D110333
2021-04-27 19:54:56 +00:00
Kashav Madan
e7ef1c3516 Bug 1705547 - Null check the SessionHistory object before attempting to collect, r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D112290
2021-04-16 12:02:17 +00:00
Kashav Madan
e520e16620 Bug 1700963 - Stop relying on the "SessionStore:addSHistoryListener" message, r=nika
We now create the listener after receiving a "browsing-context-did-set-embedder"
and destroy it after receiving "browsing-context-discarded".

Differential Revision: https://phabricator.services.mozilla.com/D110337
2021-04-14 23:36:10 +00:00
Kashav Madan
afd185bd3b Bug 1700963 - Clean up SessionStore's SHistoryListener, r=nika
This does a few things:

1. Gets rid of the listener's `_sHistoryChanges` property, which is possible
   because _sHistoryChanges == false <-> _fromIdx == kNoIndex.
2. Simplifies the code that interacts with SHistoryListener in
   UpdateSessionStoreFromTablistener, and attempts to make that function a
   little more readable.
3. Ensures we're only doing the SessionHistory bit of
   UpdateSessionStoreFromTablistener for toplevel frames, and if SHIP is
   enabled.

Differential Revision: https://phabricator.services.mozilla.com/D110336
2021-04-14 23:36:10 +00:00
Dorel Luca
2cbd35f354 Backed out 3 changesets (bug 1700963) for Browser-chrome failures in docshell/test/browser/browser_bug1309900_crossProcessHistoryNavigation.js. CLOSED TREE
Backed out changeset cda35e554327 (bug 1700963)
Backed out changeset fbafd75b06d3 (bug 1700963)
Backed out changeset 8b922e4f612b (bug 1700963)
2021-04-14 23:26:05 +03:00
Kashav Madan
e672ad7710 Bug 1700963 - Stop relying on the "SessionStore:addSHistoryListener" message, r=nika
We now create the listener after receiving a "browsing-context-did-set-embedder"
and destroy it after receiving "browsing-context-discarded".

Differential Revision: https://phabricator.services.mozilla.com/D110337
2021-04-14 18:53:06 +00:00
Kashav Madan
e8bc18afcf Bug 1700963 - Clean up SessionStore's SHistoryListener, r=nika
This cleans up the SHistoryListener class and does a few things:

1. Gets rid of the listener's `_sHistoryChanges` property, which is possible
   because _sHistoryChanges == false <-> _fromIdx == kNoIndex.
2. Simplifies the code that interacts with SHistoryListener in
   UpdateSessionStoreFromTablistener, and attempts to make that function a
   little more readable.
3. Ensures we're only doing the SessionHistory bit of
   UpdateSessionStoreFromTablistener for toplevel frames.

Differential Revision: https://phabricator.services.mozilla.com/D110336
2021-04-14 18:53:05 +00:00
Emma Malysz
a5a8f40979 Bug 1692176, add restore previous session to history panel r=jaws
Differential Revision: https://phabricator.services.mozilla.com/D110178
2021-03-31 16:22:52 +00:00
Rob Wu
878b74f39d Bug 1698192 - Use correct currentURI during swapping of lazy browsers r=dao
Re-order calls in SessionStore.jsm to invoke the side-effect-free logic
before triggering observable events.

Clear (likely) stale value of the cached currentURI when lazy browsers
are swapped.

And while I was at it, I also fixed a bug that caused a lazy browser to
eagerly be unlazified because the unneeded mute() call on a lazy browser
unlazifies it (discovered when I added complete test coverage for this
change).

Differential Revision: https://phabricator.services.mozilla.com/D108260
2021-03-26 19:51:15 +00:00
Andreas Farre
2d0871a066 Bug 1572084 - Part 2: Make Session Store data collection work with fission. r=nika
Instead of collecting data from the entire tree of documents, we
collect data per document. The collected data is sent to the
corresponding parent window context and is applied incrementally to
the tab state cache.

Differential Revision: https://phabricator.services.mozilla.com/D107814
2021-03-26 08:59:33 +00:00
Bogdan Tara
6ed704c1ea Backed out 3 changesets (bug 1572084) for WindowGlobalParent.cpp related failures CLOSED TREE
Backed out changeset d42a68132e7e (bug 1572084)
Backed out changeset 4d5a5ac074e6 (bug 1572084)
Backed out changeset 5aa59e106a42 (bug 1572084)
2021-03-25 18:56:02 +02:00
Andreas Farre
e8713aa001 Bug 1572084 - Part 2: Make Session Store data collection work with fission. r=nika
Instead of collecting data from the entire tree of documents, we
collect data per document. The collected data is sent to the
corresponding parent window context and is applied incrementally to
the tab state cache.

Differential Revision: https://phabricator.services.mozilla.com/D107814
2021-03-25 15:36:38 +00:00
Kashav Madan
b912b90222 Bug 1597499 - Make Session Restore work in Fission, r=nika
Differential Revision: https://phabricator.services.mozilla.com/D107883
2021-03-23 18:01:21 +00:00
smolnar
ede838631a Backed out 4 changesets (bug 1597499) for causing Fission crashes (bug 1699349). a=backout
Backed out changeset 0df7b8660446 (bug 1597499)
Backed out changeset d015ba9097c5 (bug 1597499)
Backed out changeset e84054ccadb0 (bug 1597499)
Backed out changeset 12762a25c4fa (bug 1597499)
2021-03-18 11:29:08 +02:00
Kashav Madan
ad57811557 Bug 1597499 - Make Session Restore work in Fission, r=nika
Differential Revision: https://phabricator.services.mozilla.com/D107883
2021-03-17 16:43:05 +00:00
Paul Bone
b1e1ee5aed Bug 1697738 - Some refactoring in SessionStore.jsm r=nika
* Remove lastKnownURI from SHistoryListener
 * Remove some dead code
 * Move some code out of a condition

Differential Revision: https://phabricator.services.mozilla.com/D107974
2021-03-15 02:08:41 +00:00
Paul Bone
bb4e53396b Bug 1691135 - pt 1. SHistoryListeners track browser ID as it is constant r=nika
Differential Revision: https://phabricator.services.mozilla.com/D106841
2021-03-12 01:16:15 +00:00
Anny Gakhokidze
c52cdbd749 Bug 1692501 - Fix timing issues when reopening all closed windows, r=kashav
In bug 1589102, changes were made to how about:blank and about:srcdoc load,
making them go via DocumentChannel and thus slightly increasing documents' load
times.  This causes some timing issues in SessionStore code.

When we click to "Reopen all (closed) Windows", undoCloseWindow() is called for
each window that we have to restore. The following scenario can occur - we are
restoring window 1, and undoCloseWindow() has already called restoreWindows,
after receiving the window showing promise, and in the meantime
undoCloseWindow() has been called for window 2, and there is now a promise in
the WINDOW_SHOWING_PROMISES. But now restoreWindows() for window1 calls
_openWindows(), where root.windows length is 0, but WINDOW_SHOWING_PROMISES is
not empty (because of window 2's undoCloseWindow), and the resolve callback for
_openWindows() gets called with wrong arg. To solve this, ensure that the
promises returned from _openWindows() correspond to the windows opened
within the body of the function.

Differential Revision: https://phabricator.services.mozilla.com/D106304
2021-03-01 19:44:13 +00:00
Tom Tung
561095f59d Bug 1666584 - Remove the code for updating _lastKnownUserContextId because it's not needed; r=nika
Differential Revision: https://phabricator.services.mozilla.com/D105334
2021-02-23 08:28:57 +00:00
Tom Tung
b4f2f352b8 Bug 1665942 - Collect userContextId from tab in _collectBaseTabData and stop collecting it in the session history collection; r=nika,geckoview-reviewers,agi
### Story

When a COOP+COEP page is opened, we change the remoteness of the tab. After
changing the remoteness, the tab is then restored by its TabState. However,
we haven't collected userContextId through the current mechanism.

To fix that, this patch changes the way to collect userContextId.

### Test Plan

Test: D98296

Depends on D98296

Differential Revision: https://phabricator.services.mozilla.com/D98468
2021-02-23 08:28:57 +00:00
Tom Tung
9a732b018b Bug 1683713 - Ensure the restoring tab is not reused in addMultipleTabs; r=dao
Differential Revision: https://phabricator.services.mozilla.com/D100249
2021-02-23 08:28:56 +00:00
Csoregi Natalia
133796a67b Backed out 2 changesets (bug 1665942, bug 1683713) for failures on browser_cookies_legacy.js. CLOSED TREE
Backed out changeset d2f4a6c7e9ca (bug 1665942)
Backed out changeset b04fe74185a0 (bug 1683713)
2021-02-17 13:28:09 +02:00
Tom Tung
ad4752a452 Bug 1665942 - Collect userContextId from tab in _collectBaseTabData and stop collecting it in the session history collection; r=nika,geckoview-reviewers,agi
### Story

When a COOP+COEP page is opened, we change the remoteness of the tab. After
changing the remoteness, the tab is then restored by its TabState. However,
we haven't collected userContextId through the current mechanism.

To fix that, this patch changes the way to collect userContextId.

### Test Plan

Test: D98296

Depends on D98296

Differential Revision: https://phabricator.services.mozilla.com/D98468
2021-02-17 07:45:13 +00:00
Tom Tung
2bd4876456 Bug 1683713 - Ensure the restoring tab is not reused in addMultipleTabs; r=dao
Differential Revision: https://phabricator.services.mozilla.com/D100249
2021-02-17 07:45:12 +00:00
Mark Banner
3475182904 Bug 1608272 - Remove 'this' as the second argument to 'ChromeUtils.import', use object destructuring instead (application changes). r=geckoview-reviewers,Gijs,agi
Differential Revision: https://phabricator.services.mozilla.com/D104684
2021-02-11 22:02:15 +00:00
Randell Jesup
0971b4bc82 Bug 1673617 - Refactor how session restore works with SHIP, r=nika
With mods from kashav's last Try run

Differential Revision: https://phabricator.services.mozilla.com/D99461
2021-02-01 22:57:14 +00:00
Kashav Madan
f7e6033cd2 Bug 1673617 - Avoid registering multiple listeners on the same browser element, r=nika
Differential Revision: https://phabricator.services.mozilla.com/D95227
2021-02-01 22:57:04 +00:00
Butkovits Atila
376e3f9b7d Backed out 3 changesets (bug 1673617) for causing failure on browser_child_resource.js. CLOSED TREE
Backed out changeset 2a0dd70342ce (bug 1673617)
Backed out changeset 6fa47045b11b (bug 1673617)
Backed out changeset d230e44fd9be (bug 1673617)
2021-01-23 04:40:22 +02:00
Randell Jesup
ef24e5a285 Bug 1673617 - Refactor how session restore works with SHIP, r=nika
With mods from kashav's last Try run

Differential Revision: https://phabricator.services.mozilla.com/D99461
2021-01-22 22:01:39 +00:00
Kashav Madan
86fd836a24 Bug 1673617 - Avoid registering multiple listeners on the same browser element, r=nika
Differential Revision: https://phabricator.services.mozilla.com/D95227
2021-01-22 19:06:16 +00:00
Randell Jesup
9d2a5e9dd0 Bug 1687517: BrowserChangedProcess event is not longer sent r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D102331
2021-01-19 17:47:29 +00:00
Dorel Luca
ad68c55baa Backed out 3 changesets (bug 1673617) for Browser-chrome failures in docshell/test/browser/browser_bug1347823.js. CLOSED TREE
Backed out changeset f0ea749647d3 (bug 1673617)
Backed out changeset 533092a71225 (bug 1673617)
Backed out changeset 3ce0d9f55436 (bug 1673617)
2021-01-19 21:00:03 +02:00
Randell Jesup
fb8153a8f2 Bug 1673617 - Refactor how session restore works with SHIP, r=nika
With mods from kashav's last Try run

Differential Revision: https://phabricator.services.mozilla.com/D99461
2021-01-19 17:21:34 +00:00
Kashav Madan
be61dd2240 Bug 1673617 - Avoid registering multiple listeners on the same browser element, r=nika
Differential Revision: https://phabricator.services.mozilla.com/D95227
2021-01-06 16:42:47 +00:00
Gijs Kruitbosch
1613604e08 Bug 1671271 - add telemetry for showing about:sessionrestore to establish if it's being shown too often, r=emalysz
Differential Revision: https://phabricator.services.mozilla.com/D99688
2020-12-17 17:08:17 +00:00
Johann Hofmann
5fd944c021 Bug 1650095 - Part 1 - Collect current entry when partially updating session history. r=kashav,Gijs
This will ensure we reflect changes that were made to that entry after it was added, see
https://phabricator.services.mozilla.com/D93346#inline-535006 for more context.

Differential Revision: https://phabricator.services.mozilla.com/D95133
2020-11-18 11:47:49 +00:00
Nika Layzell
0ed640c654 Bug 1675334 - Part 2: Remove SSHistoryReplaceEntry, r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D96614
2020-11-16 14:13:20 +00:00
Nika Layzell
265c9eff50 Bug 1671983 - Part 2: Remove SessionStore.navigateAndRestore, r=annyG,kashav
This formed the backbone of the previous process switching codepath, and
shouldn't be necessary anymore thanks to DocumentChannel's new codepath.

This also removes the eager process switching logic from frontend's _loadURI, as
it would rarely be taken, unless an invalid URI was entered, already.

Differential Revision: https://phabricator.services.mozilla.com/D94639
2020-11-12 18:00:55 +00:00
Razvan Maries
beb7584870 Backed out 7 changesets (bug 1658084, bug 1671983) for perma failures on browser_async_remove_tab.js and browser_e10s_chrome_process.js. CLOSED TREE
Backed out changeset 2e6309c1cdbd (bug 1658084)
Backed out changeset 99aafd9304ef (bug 1671983)
Backed out changeset 80280b85280a (bug 1671983)
Backed out changeset 008db2659002 (bug 1671983)
Backed out changeset 32bd45c7fe3a (bug 1671983)
Backed out changeset 56e227e6580c (bug 1671983)
Backed out changeset a404f809f79d (bug 1671983)
2020-11-04 04:23:47 +02:00
Nika Layzell
9c22d73e60 Bug 1671983 - Part 2: Remove SessionStore.navigateAndRestore, r=annyG,kashav
This formed the backbone of the previous process switching codepath, and
shouldn't be necessary anymore thanks to DocumentChannel's new codepath.

This also removes the eager process switching logic from frontend's _loadURI, as
it would rarely be taken, unless an invalid URI was entered, already.

Differential Revision: https://phabricator.services.mozilla.com/D94639
2020-11-04 00:55:23 +00:00
Csoregi Natalia
65fb84213f Bug 1673878 - Fix eslint. r=lint-fix CLOSED TREE 2020-10-30 18:21:44 +02:00
Andreas Farre
0d06aea979 Bug 1673878 - Collect all session history entries for SHIP when needed. r=peterv
When seeing DOMTitleChanged in mozilla::dom::TabListener::HandleEvent
or mozilla::dom::ContentSessionStore::{nDocumentStart/OnDocumentEnd}
we should do a full collect of all session history entries in the
parent.

Differential Revision: https://phabricator.services.mozilla.com/D95140
2020-10-30 15:16:51 +00:00
Michael Goossens
2178688ff4 Bug 1649600 - Remove unused osfile import in SessionStore.jsm r=emalysz
Differential Revision: https://phabricator.services.mozilla.com/D93596
2020-10-14 22:38:13 +00:00
Drew Willcoxon
0d14fe78c3 Bug 1670932 - Don't restore urlbar search mode due to remoteness change. r=mak
When navigating to a new URL that requires a remoteness change, session store
restores the tab after the change. The restore races the `gURLBar.setURI` call
that happens due to the location change. If the restore happens after the
`setURI` call, then the search mode is "restored" even though a new page was
loaded.

The session store code surrounding the chunk that I modified in bug 1655486
checks for a remoteness change before trying to restore `userTypedValue`. If the
restore is due to a remoteness change, then it doesn't restore `userTypedValue`.
We just need to do the same for search mode.

Also, I think we should be using `TabStateCache` here, not `TabState.collect`.
`TabStateCache` is updated in `restoreTab` and is available throughout the
restore process. `TabState.collect` on the other hand is a live view of the
given tab, so if search mode happens to be active when `collect` is called, then
the returned tab state will have `searchMode` defined, which is not what we want
here. But I'm not sure why the surrounding code here uses `TabState.collect`
instead of `TabStateCache` in order to restore `userTypedValue`. It seems like
an error to me, but I might be missing something.

Due to the racey nature of this bug, writing a test isn't so easy, so this patch
doesn't have one. It will be obvious through manual testing if this regresses.

Differential Revision: https://phabricator.services.mozilla.com/D93455
2020-10-14 13:23:31 +00:00
Drew Willcoxon
a3eec99d1b Bug 1655486 - Support search mode across sessions. r=mak
* Always update the `_searchModesByBrowser` map when entering/exiting search
  mode, not only for non-selected browsers, so that search mode can be saved and
  restored properly per tab.
* Rename `setSearchMode` to `_updateSearchModeUI` and make it only update the UI.
* Add a new `setSearchMode` method that takes a browser and updates the map.
* Add `getSearchMode` so that SessionStore can get the search mode for a given
  browser.
* Add a `searchMode` getter and setter for convenience. They call
  `getSearchMode` and `setSearchMode` with the selected browser.

Differential Revision: https://phabricator.services.mozilla.com/D91910
2020-10-12 03:34:59 +00:00
Peter Van der Beken
42db9833f7 Bug 1668052 - Pass the BrowserParent's browsing context to UpdateSessionStore instead of getting it from the frame element's frameloader. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D91766
2020-10-04 08:55:07 +00:00