Commit Graph

3304 Commits

Author SHA1 Message Date
Butkovits Atila
0d09646c51 Backed out 8 changesets (bug 1650089) for causing Xpcshell failures on test_ext_redirects.js. CLOSED TREE
Backed out changeset ee763318d378 (bug 1650089)
Backed out changeset 24d7898ec4bd (bug 1650089)
Backed out changeset bcdd2f5c9840 (bug 1650089)
Backed out changeset 24a5bd7f97dd (bug 1650089)
Backed out changeset 1b8b4e939e82 (bug 1650089)
Backed out changeset a7a4f37a5d72 (bug 1650089)
Backed out changeset 78c012d4b071 (bug 1650089)
Backed out changeset e870508c1ddc (bug 1650089)
2021-08-06 04:35:52 +03:00
Nika Layzell
c1e1efbbcb Bug 1650089 - Part 1: Add a remoteTypeOverride option for about:blank loads triggered by chrome, r=annyG,kmag
After the changes in this bug, about:blank loads triggered by chrome will
finish in a "web" content process, as they have an untrusted null principal
without a precursor. In a few places throughout the codebase, however, we
perform about:blank loads with the explicit expectation that they do not change
processes. This new remoteTypeOverride option allows the intended final process
to be explicitly specified in this situation.

For security & simplicity reasons, this new attribute is limited to only be
usable on system-principal triggered loads of about:blank in toplevel browsing
contexts.

Differential Revision: https://phabricator.services.mozilla.com/D120671
2021-08-06 00:10:56 +00:00
Doug Thayer
d2681b7dad Bug 1546847 - SessionStore _cachedObjs fixup code for backout r=Gijs
Depends on D121898

Differential Revision: https://phabricator.services.mozilla.com/D121899
2021-08-05 18:34:57 +00:00
Doug Thayer
422c3e0585 Bug 1546847 - Backed out bug 1546847 and related revs r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D121898
2021-08-05 18:34:56 +00:00
Doug Thayer
30e8897bfb Bug 1723725 - Fix SessionWorkerCache import cleanup r=Gijs
The effect of this bug should be a slow leak of unreferenced cache entries
between sessions. After the fix we should just be appropriately cleaning them
up.

Differential Revision: https://phabricator.services.mozilla.com/D121644
2021-08-04 23:56:42 +00:00
Alexandru Michis
c8caa831d9 Backed out 7 changesets (bug 1650089) for causing xpcshell failures in test_ext_cookieBehaviors.js
Backed out changeset 336d6eb2fc15 (bug 1650089)
Backed out changeset 283ba29cdbeb (bug 1650089)
Backed out changeset c470e4c65117 (bug 1650089)
Backed out changeset 8fc2f428694d (bug 1650089)
Backed out changeset 37e5185dae14 (bug 1650089)
Backed out changeset a26afdc56d91 (bug 1650089)
Backed out changeset 32e207558b3d (bug 1650089)
2021-08-04 12:32:07 +03:00
Noemi Erli
dd0c0e4f6e Backed out changeset a8347fc2ff27 (bug 1723725) for causing failures in browser_sessionWorkerCacheImport.js CLOSED TREE 2021-08-04 00:20:38 +03:00
Doug Thayer
b65964236b Bug 1723725 - Fix SessionWorkerCache import cleanup r=Gijs
The effect of this bug should be a slow leak of unreferenced cache entries
between sessions. After the fix we should just be appropriately cleaning them
up.

Differential Revision: https://phabricator.services.mozilla.com/D121644
2021-08-03 18:48:00 +00:00
Nika Layzell
56bfde27c5 Bug 1650089 - Part 1: Add a remoteTypeOverride option for about:blank loads triggered by chrome, r=annyG,kmag
After the changes in this bug, about:blank loads triggered by chrome will
finish in a "web" content process, as they have an untrusted null principal
without a precursor. In a few places throughout the codebase, however, we
perform about:blank loads with the explicit expectation that they do not change
processes. This new remoteTypeOverride option allows the intended final process
to be explicitly specified in this situation.

For security & simplicity reasons, this new attribute is limited to only be
usable on system-principal triggered loads of about:blank in toplevel browsing
contexts.

Differential Revision: https://phabricator.services.mozilla.com/D120671
2021-08-03 18:17:54 +00:00
Noemi Erli
dec3cca55f Backed out 7 changesets (bug 1650089) foe causing bustages in ProcessIsolation.cpp
Backed out changeset 4e73beb8872c (bug 1650089)
Backed out changeset 092451e931ce (bug 1650089)
Backed out changeset ca9ba60010c6 (bug 1650089)
Backed out changeset ee61b69ba556 (bug 1650089)
Backed out changeset 091c4efa36a7 (bug 1650089)
Backed out changeset dbdee40ef8a0 (bug 1650089)
Backed out changeset 54d12a4333a0 (bug 1650089)
2021-08-03 20:15:54 +03:00
Nika Layzell
0c2e579295 Bug 1650089 - Part 1: Add a remoteTypeOverride option for about:blank loads triggered by chrome, r=annyG,kmag
After the changes in this bug, about:blank loads triggered by chrome will
finish in a "web" content process, as they have an untrusted null principal
without a precursor. In a few places throughout the codebase, however, we
perform about:blank loads with the explicit expectation that they do not change
processes. This new remoteTypeOverride option allows the intended final process
to be explicitly specified in this situation.

For security & simplicity reasons, this new attribute is limited to only be
usable on system-principal triggered loads of about:blank in toplevel browsing
contexts.

Differential Revision: https://phabricator.services.mozilla.com/D120671
2021-08-03 15:39:33 +00:00
Doug Thayer
1099a0fe75 Bug 1546847 - Cache tab icons in worker to avoid serialization r=kashav
Read this as a first step. It's the easiest first step I could think of to
both reduce the quantity of stuff we serialize and ship to the worker as
well as to spread it out over multiple messages.

Anyway, the motivation is pretty simple. Taking a look at a session store
file on disk, a giant chunk of it is base64 encoded tab icons. I suspect
that in many cases these are not distinct. For my session store it's about
90% the same repeated searchfox icon over and over.

So what I did was I changed the "image" property of the tab to be a reference
into a deduplicated cache of objects (in this case strings). Whenever the tab
icon changes, we drop a reference to its cache entry and add a reference to a
new or existing entry. Each time a cache entry is added or deleted, we send
a message to the worker to update its own copy of the cache. This does
represent a memory hit, since the cache is maintained on the worker as well as
the main thread, but I think it's going to be minor, and it's only in one
process. Given the deduplication there is the possibility of an overall
reduction in memory use? This needs more testing.

Once it comes time to write the session data to disk, we send the payload with
"image" entries referencing IDs in the cache. When the worker gets the message
to write, it adds its internal cache to the object, which it then serializes
to JSON and writes to disk as usual.

When reading the data off disk, we take the cache items that had been written
and we slowly populate the worker's internal cache with them (to not overload
during startup with a giant message). And when populating tab icons of tabs in
the tab strip, we look up the image in the main thread copy of the cache. Also,
if we cannot find the entry, we assume that the image is just the raw
representation of the image. This ensures that we interpret a sessionstore file
from prior to this patch correctly.

Additionally, since we have the cache duplicated on both threads, if the worker
gets terminated for some reason, we rehydrate it with the snapshot of the cache
from when we noticed it was a problem.

I suspect some tests will need to be updated, or maybe many tests. However I
wanted to throw this patch past someone with more knowledge of the session
store's inner workings before throwing a bunch of time at that.

Differential Revision: https://phabricator.services.mozilla.com/D114196
2021-08-02 16:17:30 +00:00
Dorel Luca
0ec812b2f0 Backed out 5 changesets (bug 1650089) for Browser-chrome failures in browser/components/originattributes/test/browser/browser_firstPartyIsolation_aboutPages.js. CLOSED TREE
Backed out changeset 26ddad079ad3 (bug 1650089)
Backed out changeset 5ae2b2641484 (bug 1650089)
Backed out changeset c5d267a1907c (bug 1650089)
Backed out changeset d9eeca699dec (bug 1650089)
Backed out changeset 8bb303f6831a (bug 1650089)
2021-07-29 05:53:31 +03:00
Nika Layzell
9e235a6989 Bug 1650089 - Part 1: Add a remoteTypeOverride option for about:blank loads triggered by chrome, r=annyG,kmag
After the changes in this bug, about:blank loads triggered by chrome will
finish in a "web" content process, as they have an untrusted null principal
without a precursor. In a few places throughout the codebase, however, we
perform about:blank loads with the explicit expectation that they do not change
processes. This new remoteTypeOverride option allows the intended final process
to be explicitly specified in this situation.

For security & simplicity reasons, this new attribute is limited to only be
usable on system-principal triggered loads of about:blank in toplevel browsing
contexts.

Differential Revision: https://phabricator.services.mozilla.com/D120671
2021-07-29 01:40:19 +00:00
Christoph Kerschbaumer
5ee0a6a910 Bug 1719272: Annotate failing browser/ tests to potentially enable https-first mode in Nightly r=webcompat-reviewers,denschub,webdriver-reviewers,preferences-reviewers,Gijs,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D119177
2021-07-28 19:16:16 +00:00
Sandor Molnar
5e383dfda4 Backed out changeset 7eb8945dd8e3 (bug 1719272) for causing bustages in gecko decision task. CLOSED TREE 2021-07-28 19:47:06 +03:00
Christoph Kerschbaumer
8fef13ba13 Bug 1719272: Annotate failing browser/ tests to potentially enable https-first mode in Nightly r=webcompat-reviewers,denschub,webdriver-reviewers,preferences-reviewers,Gijs,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D119177
2021-07-28 16:08:07 +00:00
Kashav Madan
8008df9a7e Bug 1722235 - Unskip browser_sessionStorage.js for Fission, r=annyG
Differential Revision: https://phabricator.services.mozilla.com/D120802
2021-07-27 03:59:17 +00:00
Antonin LOUBIERE
7a92a54c90 Bug 490136 - fix last tab re-opening after the close with session restore. r=Gijs
If one closes the last tab with the session restore enabled, it will re-open after restart.
Fix that by closing completely the tabs before the stop of the browser.

Differential Revision: https://phabricator.services.mozilla.com/D118270
2021-07-21 10:28:02 +00:00
Sandor Molnar
6dce466046 Backed out changeset da1412413022 (bug 490136) for causing bc failures in sessionstore/test/browser_625016. CLOSED TREE 2021-07-20 20:04:22 +03:00
Antonin LOUBIERE
2836aef3d9 Bug 490136 - fix last tab re-opening after the close with session restore. r=Gijs
If one closes the last tab with the session restore enabled, it will re-open after restart.
Fix that by closing completely the tabs before the stop of the browser.

Differential Revision: https://phabricator.services.mozilla.com/D118270
2021-07-20 10:42:48 +00:00
Kashav Madan
0879959a9e Bug 1677540 - Start loads directly on the browser instead of in a SpecialPowers task, r=annyG
Differential Revision: https://phabricator.services.mozilla.com/D119556
2021-07-16 17:51:06 +00:00
Kashav Madan
27b6c91f73 Bug 1718436 - Don't register the "Recently Closed Tabs" middle click handler for menuitems, r=Gijs
This causes us to handle middle clicks twice for menuitems, which results in us
opening two recent tabs instead of one. The regressing bug dealt with similar
problems in D112046.

This also updates the other RecentlyClosedTabsAndWindowsMenuUtils.get*Fragment
caller to use the full function names instead of strings.

Differential Revision: https://phabricator.services.mozilla.com/D119544
2021-07-16 13:44:21 +00:00
Anny Gakhokidze
e1bf9e611c Bug 1646356 - Wait for hashchange event in a different way for browser_sessionHistory.js, r=kashav
Differential Revision: https://phabricator.services.mozilla.com/D119458
2021-07-09 20:58:17 +00:00
Anny Gakhokidze
33a3d37016 Bug 1692749 - Skip superfluous about:blank load when duplicating a tab, r=kashav,extension-reviewers,kmag
When we duplicate a tab, we don't need to have about:blank load in it, because
we are going to use restore mechanism to copy data into the new tab. If we
don't skip the superfluous load, the restoring process might race with the
loading of about:blank, and sometimes we might try to destroy the
WindowGlobalChild actor just as SessionStore is trying to restore docshell
capabilities for that tab resulting in a rejected promise in _restoreHistory
and `_restoreHistoryComplete` not getting called.

Differential Revision: https://phabricator.services.mozilla.com/D119313
2021-07-08 22:31:52 +00:00
Marian-Vasile Laza
f6e8cad90d Backed out changeset 41171ae56f5e (bug 1692749) for causing bc failures on browser_searchMode_sessionStore.js. CLOSED TREE 2021-07-08 02:37:31 +03:00
Anny Gakhokidze
fc48a089ea Bug 1692749 - Skip superfluous about:blank load when duplicating a tab, r=kashav,extension-reviewers,kmag
When we duplicate a tab, we don't need to have about:blank load in it, because
we are going to use restore mechanism to copy data into the new tab. If we
don't skip the superfluous load, the restoring process might race with the
loading of about:blank, and sometimes we might try to destroy the
WindowGlobalChild actor just as SessionStore is trying to restore docshell
capabilities for that tab resulting in a rejected promise in _restoreHistory
and `_restoreHistoryComplete` not getting called.

Differential Revision: https://phabricator.services.mozilla.com/D119313
2021-07-07 22:08:46 +00:00
Alexandru Michis
89e1d83836 Bug 1638958 - Disable browser_label_and_icon.js on OS X 10.15 for frequent failures. r=intermittent-reviewers,ahal DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D118297
2021-06-26 21:23:31 +00:00
Kashav Madan
3b6f8b305d Bug 1703692 - Update SessionStore and TabState{,Cache} functions to take a permanentKey, r=nika
Differential Revision: https://phabricator.services.mozilla.com/D118541
2021-06-26 20:25:29 +00:00
Kashav Madan
a1f3331643 Bug 1703692 - Store the latest embedder's permanent key on CanonicalBrowsingContext, r=nika,mccr8
And include it in Session Store flushes to avoid dropping updates in case the
browser is unavailable.

Differential Revision: https://phabricator.services.mozilla.com/D118385
2021-06-26 20:25:29 +00:00
Dorel Luca
c293dee662 Backed out 3 changesets (bug 1703692) for Browser-chrome failures in browser/components/sessionstore/test/browser_broadcast.js. CLOSED TREE
Backed out changeset fe5703d7b580 (bug 1703692)
Backed out changeset eec4a4138ca7 (bug 1703692)
Backed out changeset 6745b363a745 (bug 1703692)
2021-06-26 10:09:23 +03:00
Kashav Madan
d3a7f8a79a Bug 1703692 - Update SessionStore and TabState{,Cache} functions to take a permanentKey, r=nika
Differential Revision: https://phabricator.services.mozilla.com/D118541
2021-06-26 05:49:12 +00:00
Kashav Madan
bb26572412 Bug 1703692 - Store the latest embedder's permanent key on CanonicalBrowsingContext, r=nika,mccr8
And include it in Session Store flushes to avoid dropping updates in case the
browser is unavailable.

Differential Revision: https://phabricator.services.mozilla.com/D118385
2021-06-26 05:49:12 +00:00
Anny Gakhokidze
3325abe58b Bug 1646356 - Add extra logs to browser_sessionHistory.js, r=zombie
Differential Revision: https://phabricator.services.mozilla.com/D118867
2021-06-25 21:10:50 +00:00
Iulian Moraru
6f300817be Backed out 3 changesets (bug 1703692) for causing bc failures on multiple files.
Backed out changeset a199dfd8ce8d (bug 1703692)
Backed out changeset 599a0a99ded9 (bug 1703692)
Backed out changeset 14fe807e6be4 (bug 1703692)
2021-06-25 00:43:23 +03:00
Kashav Madan
7728d0686d Bug 1703692 - Update SessionStore and TabState{,Cache} functions to take a permanentKey, r=nika
Differential Revision: https://phabricator.services.mozilla.com/D118541
2021-06-24 20:26:14 +00:00
Kashav Madan
bc90a488f7 Bug 1703692 - Store the latest embedder's permanent key on CanonicalBrowsingContext, r=nika,mccr8
And include it in Session Store flushes to avoid dropping updates in case the
browser is unavailable.

Differential Revision: https://phabricator.services.mozilla.com/D118385
2021-06-24 20:26:13 +00:00
Kashav Madan
61b1f1a622 Bug 1696815 - Wait for the _restoreHistory() promise before firing SSTabRestored, r=annyG
Differential Revision: https://phabricator.services.mozilla.com/D118501
2021-06-23 16:15:51 +00:00
Kashav Madan
0795de2ffe Bug 1696815 - Handle browser.loadURI() calls that happen before the browser is fully restored, r=annyG,nika,zombie
Differential Revision: https://phabricator.services.mozilla.com/D118101
2021-06-23 16:15:51 +00:00
Alexandru Michis
8d8a297193 Backed out 2 changesets (bug 1696815) for causing bc failures in browser_ext_tabs_discard_reversed.js
CLOSED TREE

Backed out changeset b52bf621dbe4 (bug 1696815)
Backed out changeset ca4535b8d3aa (bug 1696815)
2021-06-23 02:09:45 +03:00
Kashav Madan
df28ff8395 Bug 1696815 - Wait for the _restoreHistory() promise before firing SSTabRestored, r=annyG
Differential Revision: https://phabricator.services.mozilla.com/D118501
2021-06-22 19:58:42 +00:00
Kashav Madan
d6c17ef6fa Bug 1696815 - Handle browser.loadURI() calls that happen before the browser is fully restored, r=annyG,nika,zombie
Differential Revision: https://phabricator.services.mozilla.com/D118101
2021-06-22 19:58:42 +00:00
Kashav Madan
16ff97f61f Bug 1713900 - Remove platform-specific Fission sessionstore annotations from bug 1694824, r=neha
Most of these fail very rarely (if at all), and the ones that do already have
intermittent bugs filed.

See comment #6.

Differential Revision: https://phabricator.services.mozilla.com/D118005
2021-06-16 16:26:42 +00:00
Kashav Madan
9778a93dc8 Bug 1716444 - Don't do final tab state flush for replaced contexts, r=farre,annyG
If we're destroying the frame loader of a replaced browsing context we'll end up
firing browser-shutdown-tabstate-updated for a tab that wasn't actually closed.

This results in us cleaning up Session Store state earlier than expected, which
means we drop future updates to SessionStoreInternal._closedTabs.

Fixes browser_sessionHistory.js, browser_async_remove_tab.js, and possibly
browser_491168.js for SHIP+BFCache.

Differential Revision: https://phabricator.services.mozilla.com/D117944
2021-06-16 14:05:53 +00:00
Kashav Madan
d2b4f475d7 Bug 1701337 - Respect browser.sessionstore.debug.no_auto_updates in native flushers, r=nika
We should not be doing any timed flushes if the pref is set to true.

See https://searchfox.org/mozilla-central/rev/d97dca5907e2a0a77a2435b24ef980268cd3c4fe/browser/components/sessionstore/ContentSessionStore.jsm#402
for how the pref is used in non-SHIP code.

Fixes browser_async_window_flushing.js, which relies on us not sending automatic
updates.

Differential Revision: https://phabricator.services.mozilla.com/D117953
2021-06-16 00:37:53 +00:00
Anny Gakhokidze
c2b1603140 WIP: Bug 1713713 - Remove pref that decides if OriginAttributes should be used in a remote type r=nika
Differential Revision: https://phabricator.services.mozilla.com/D117926
2021-06-16 00:31:15 +00:00
Kashav Madan
ad9c02d578 Bug 1715852 - Fix SessionHistoryEntry::mSrcdocData to work with session restore, r=peterv
Not setting mIsSrcdocEntry causes us to drop srcdoc data and not set
INTERNAL_LOAD_FLAGS_IS_SRCDOC in FillLoadInfo for srcdoc restores.

Differential Revision: https://phabricator.services.mozilla.com/D117479
2021-06-15 13:34:01 +00:00
Kris Maglione
799bf19224 Bug 1646560: Part 2 - Move allowJavascript and friends from DocShell to BrowsingContext and WindowContext. r=jdescottes,nika,geckoview-reviewers,devtools-backward-compat-reviewers,agi
This is slightly complicated by the fact that the editor code wants to be able
to set this from the content process, so we really need separate
BrowsingContext and WindowContext flags, the latter of which can be set by the
owning process.

Differential Revision: https://phabricator.services.mozilla.com/D114899
2021-06-15 04:40:11 +00:00
Andreas Farre
b9e6293b00 Bug 1705689 - Don't update the tab state if the browsing context has been replaced. r=kashav
Differential Revision: https://phabricator.services.mozilla.com/D117266
2021-06-14 13:48:49 +00:00
Ed Lee
5e8f1563a8 Bug 1633883 - TelemetryTestUtils.assertScalar assumes Number (so behaves odd for boolean, strings) r=chutten
Split assertScalar to assertScalarUnset to allow the former to plain check the value including strings, false and 0.

Differential Revision: https://phabricator.services.mozilla.com/D117457
2021-06-11 21:06:26 +00:00