Commit Graph

79 Commits

Author SHA1 Message Date
Tooru Fujisawa
328d63ce7f Bug 1777486 - Part 2: Migrate XPCOMUtils.jsm consumers with automatic migration. r=webdriver-reviewers,geckoview-reviewers,preferences-reviewers,application-update-reviewers,pip-reviewers,kmag,owlish,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D151214
2022-07-12 04:21:34 +00:00
Andreea Pavel
f009ba2983 Backed out 11 changesets (Bug 1777486) for failing bc at browser_startup.js on a CLOSED TREE
Backed out changeset b6c4c386f1a6 (Bug 1777486)
Backed out changeset 195cc2de8433 (Bug 1777486)
Backed out changeset 20c746fb1648 (Bug 1777486)
Backed out changeset d5fd8173d62d (Bug 1777486)
Backed out changeset 6d758fab5a3e (Bug 1777486)
Backed out changeset e938b601ba15 (Bug 1777486)
Backed out changeset 0c4ea0b9416b (Bug 1777486)
Backed out changeset 0559c53cc668 (Bug 1777486)
Backed out changeset eea573d3a9f9 (Bug 1777486)
Backed out changeset 9ce3a6496a49 (bug 1777486)
Backed out changeset b0867652fc48 (bug 1777486)
2022-07-11 22:24:40 +03:00
Tooru Fujisawa
bf0a8b781b Bug 1777486 - Part 2: Migrate XPCOMUtils.jsm consumers with automatic migration. r=webdriver-reviewers,geckoview-reviewers,preferences-reviewers,application-update-reviewers,pip-reviewers,kmag,owlish,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D151214
2022-07-11 15:09:13 +00:00
Tooru Fujisawa
b10d0289af Bug 1667455 - Part 4: Stop importing Services.jsm from JSM. r=kmag,webdriver-reviewers,perftest-reviewers,webcompat-reviewers,geckoview-reviewers,application-update-reviewers,pip-reviewers,twisniewski,devtools-reviewers,m_kato,jdescottes,ochameau,mconley,sfoster,AlexandruIonescu
Differential Revision: https://phabricator.services.mozilla.com/D150893
2022-07-11 12:41:50 +00:00
Tooru Fujisawa
bf9248c6a6 Bug 1772100 - Part 16: Use plain object for lazy getter in browser/components/sessionstore/. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D148026
2022-06-06 22:46:25 +00:00
Barret Rennie
352961fbb0 Bug 1761652 - Fail to write session file more gracefully if we started in permanent private browsing r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D143103
2022-04-07 15:25:29 +00:00
Kagami Sascha Rosylight
d6ec873f16 Bug 1703953 - Part 2: Apply mozilla/use-isInstance rules for .jsm files r=webdriver-reviewers,pip-reviewers,mhowell,Gijs,whimboo
This replaces all `instanceof` uses for DOM interfaces, since the operator in priviliged context works same as .isInstance().

Differential Revision: https://phabricator.services.mozilla.com/D141785
2022-04-06 11:57:57 +00:00
criss
0038e58f1f Backed out 3 changesets (bug 1703953) for causing multiple failures. CLOSED TREE
Backed out changeset 871a1fac289e (bug 1703953)
Backed out changeset 8151244bda18 (bug 1703953)
Backed out changeset eaf6d4c353be (bug 1703953)
2022-03-29 17:01:58 +03:00
Kagami Sascha Rosylight
f3126104f8 Bug 1703953 - Part 2: Apply mozilla/use-isInstance rules for .jsm files r=webdriver-reviewers,pip-reviewers,mhowell,Gijs,whimboo
This replaces all `instanceof` uses for DOM interfaces, since the operator in priviliged context works same as .isInstance().

Differential Revision: https://phabricator.services.mozilla.com/D141785
2022-03-29 13:11:00 +00:00
Mathew Hodson
df2a53e9ea Bug 1752853 - Stop using a worker to write session store. r=Gijs,Standard8
Remove now unused pref "browser.sessionstore.max_write_failures".
Rename and simplify test_shutdown_cleanup.js to make it more clear that
it is testing the isFinalWrite option.

Differential Revision: https://phabricator.services.mozilla.com/D137930
2022-03-25 19:42:36 +00:00
Barret Rennie
3e6dfbcf31 Bug 1749996 - Ensure CrashMonitor writes sessionstore final checkpoint before IOUtils shuts down r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D137797
2022-02-05 20:57:50 +00:00
Butkovits Atila
acc15d025a Backed out changeset da0571b0cff0 (bug 1749996) for causing failures at IOUtils. CLOSED TREE 2022-02-04 18:52:19 +02:00
Barret Rennie
2faa8390f8 Bug 1749996 - Ensure CrashMonitor writes all checkpoints before IOUtils shuts down r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D137797
2022-02-04 15:58:57 +00:00
Michelle Goossens
45f6a21a10 Bug 1649599 - Convert SessionFile.jsm to use IOUtils r=Standard8
Depends on D99960

Differential Revision: https://phabricator.services.mozilla.com/D99570
2021-10-16 07:57:56 +00:00
Cosmin Sabou
3242939660 Backed out 2 changesets (bug 1735500, bug 1649599) for causing both Bug 1735649 and Bug 1735650.
Backed out changeset c7b8bd49a741 (bug 1649599)
Backed out changeset 8f569a8aacf0 (bug 1735500)
2021-10-14 00:47:48 +03:00
Michelle Goossens
42060b3f1f Bug 1649599 - Convert SessionFile.jsm to use IOUtils r=Standard8
Depends on D99960

Differential Revision: https://phabricator.services.mozilla.com/D99570
2021-10-13 14:45:55 +00:00
Mark Banner
f321dfd6b1 Bug 1729460 - Change users of defineLazyServiceGetter(s) to use Services.* where appropriate. r=mossop,webdriver-reviewers,extension-reviewers,whimboo,robwu
Differential Revision: https://phabricator.services.mozilla.com/D124838
2021-09-10 12:09:49 +00:00
Noemi Erli
20dee875a7 Backed out 2 changesets (bug 1729460) for causing newtab failures CLOSED TREE
Backed out changeset 5617839462be (bug 1729460)
Backed out changeset 6d52fde3ee0e (bug 1729460)
2021-09-10 13:14:12 +03:00
Mark Banner
6a5ffbcc55 Bug 1729460 - Change users of defineLazyServiceGetter(s) to use Services.* where appropriate. r=mossop,webdriver-reviewers,extension-reviewers,whimboo,robwu
Differential Revision: https://phabricator.services.mozilla.com/D124838
2021-09-10 09:38:42 +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
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
Bogdan Tara
bd2e8192a5 Backed out changeset 35518cae413a (bug 1649605) for test_Promise.js & test_compression.js xpc failures CLOSED TREE 2021-01-07 05:56:19 +02:00
Emma Malysz
357bdcf0c8 Bug 1649605: remove OS.File import from SessionWorker.jsm and replace OS.File usage in SessionWorker.js r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D100352
2021-01-06 23:27:43 +00:00
Mihai Alexandru Michis
497e4e7179 Backed out changeset 453811f08638 (bug 1649599) for causing performance regressions seen in Bug 1683885.
CLOSED TREE
2020-12-22 19:15:23 +02:00
Michael Goossens
912b925976 Bug 1649599 - Convert SessionFile.jsm to use IOUtils r=emalysz
Differential Revision: https://phabricator.services.mozilla.com/D99570
2020-12-17 19:42:09 +00:00
Butkovits Atila
df76b2f12d Backed out changeset 17448bde9d5d (bug 1649599) for turning Bug 1579683 into permafail. CLOSED TREE 2020-12-15 10:01:22 +02:00
Michael Goossens
79ea589fa4 Bug 1649599 - Convert SessionFile.jsm to use IOUtils r=emalysz
Differential Revision: https://phabricator.services.mozilla.com/D99570
2020-12-11 23:46:35 +00:00
Victor Porof
8eb72fd3fc Bug 1561435 - Format browser/components/, a=automatic-formatting
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D36042
2019-07-05 09:53:32 +02:00
Mike de Boer
2d148b224b Bug 1554076 - Stop relying on the startup module - SessionStartup.jsm - to inform us of the runtime state, which is the responsibility of SessionStore.jsm. r=dao
Differential Revision: https://phabricator.services.mozilla.com/D32734
2019-05-28 06:46:53 +00:00
Kris Maglione
856fa07b17 Bug 1514594: Part 3 - Change ChromeUtils.import API.
***
Bug 1514594: Part 3a - Change ChromeUtils.import to return an exports object; not pollute global. r=mccr8

This changes the behavior of ChromeUtils.import() to return an exports object,
rather than a module global, in all cases except when `null` is passed as a
second argument, and changes the default behavior not to pollute the global
scope with the module's exports. Thus, the following code written for the old
model:

  ChromeUtils.import("resource://gre/modules/Services.jsm");

is approximately the same as the following, in the new model:

  var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");

Since the two behaviors are mutually incompatible, this patch will land with a
scripted rewrite to update all existing callers to use the new model rather
than the old.
***
Bug 1514594: Part 3b - Mass rewrite all JS code to use the new ChromeUtils.import API. rs=Gijs

This was done using the followng script:

https://bitbucket.org/kmaglione/m-c-rewrites/src/tip/processors/cu-import-exports.jsm
***
Bug 1514594: Part 3c - Update ESLint plugin for ChromeUtils.import API changes. r=Standard8

Differential Revision: https://phabricator.services.mozilla.com/D16747
***
Bug 1514594: Part 3d - Remove/fix hundreds of duplicate imports from sync tests. r=Gijs

Differential Revision: https://phabricator.services.mozilla.com/D16748
***
Bug 1514594: Part 3e - Remove no-op ChromeUtils.import() calls. r=Gijs

Differential Revision: https://phabricator.services.mozilla.com/D16749
***
Bug 1514594: Part 3f.1 - Cleanup various test corner cases after mass rewrite. r=Gijs
***
Bug 1514594: Part 3f.2 - Cleanup various non-test corner cases after mass rewrite. r=Gijs

Differential Revision: https://phabricator.services.mozilla.com/D16750
2019-01-17 10:18:31 -08:00
Mark Banner
462116b7f9 Bug 1486739 - Add missing dangling commas in browser/, services/, taskcluster/ and toolkit/. r=mossop
Automatic changes by ESLint, except for manual corrections for .xml files.

Differential Revision: https://phabricator.services.mozilla.com/D4439
2018-08-31 05:59:17 +00:00
Dão Gottwald
bfd25b09a2 Bug 1369456 - Replace nsSessionStartup.js with SessionStartup.jsm. r=florian
MozReview-Commit-ID: 53Mu4zb9X1C
2018-08-04 13:27:40 +02:00
Mike de Boer
ef69d41ff7 Bug 1471194 - Remove the expiring scalar Telemetry probe 'worker_restart_count', since it has served its purpose well. r=liuche
We've been able to validate that the sessionstore worker restarts, as implemented
in bug 1402267, are working as expected and that worker threads are indeed _not_
infallible during the main process' lifetime.

MozReview-Commit-ID: Le8AJhlWMn8
2018-07-12 12:56:04 +02:00
Kris Maglione
b3990a2d91 Bug 1456686: Part 1 - Fix unused and shadowed explicit imports. r=standard8
These issues were previously ignored due to the nature of our global import
rules. They need to be fixed before that rule can be updated.

MozReview-Commit-ID: DCChktTc5TW
2018-04-24 20:18:09 -07:00
Brian Grinstead
c116f51a86 Bug 1440094 - Remove imports to Console.jsm that only access the 'console' object;r=mossop
Importing this object is unnecessary after the updates to the WebIDL console from Bug 1425574
and the follow-ups blocking Bug 1430810. There are still callers that access Console.jsm
to create custom ConsoleAPI objects, but those will be handled separately.

MozReview-Commit-ID: 9ojFxtkpPId
2018-02-27 11:29:59 -08:00
Florian Quèze
f1a55f73f8 Bug 1440284 - change this.EXPORTED_SYMBOLS back to var EXPORTED_SYMBOLS in JS modules, r=mccr8. 2018-02-23 20:50:01 +01:00
Andrew McCreight
272cee1e65 Bug 1432992, part 1 - Remove definitions of Ci, Cr, Cc, and Cu. r=florian
This patch was autogenerated by my decomponents.py

It covers almost every file with the extension js, jsm, html, py,
xhtml, or xul.

It removes blank lines after removed lines, when the removed lines are
preceded by either blank lines or the start of a new block. The "start
of a new block" is defined fairly hackily: either the line starts with
//, ends with */, ends with {, <![CDATA[, """ or '''. The first two
cover comments, the third one covers JS, the fourth covers JS embedded
in XUL, and the final two cover JS embedded in Python. This also
applies if the removed line was the first line of the file.

It covers the pattern matching cases like "var {classes: Cc,
interfaces: Ci, utils: Cu, results: Cr} = Components;". It'll remove
the entire thing if they are all either Ci, Cr, Cc or Cu, or it will
remove the appropriate ones and leave the residue behind. If there's
only one behind, then it will turn it into a normal, non-pattern
matching variable definition. (For instance, "const { classes: Cc,
Constructor: CC, interfaces: Ci, utils: Cu } = Components" becomes
"const CC = Components.Constructor".)

MozReview-Commit-ID: DeSHcClQ7cG
2018-02-06 09:36:57 -08:00
Mike de Boer
ea070295a4 Bug 1427007 - Part 2: the SessionFile unit tests dependended on a very specific interaction between wipe() and read(), which changed in part 1. This fixes the tests up by making the dependency a bit more clear and explicit. r=Yoric
MozReview-Commit-ID: uoPx46cNL1
2018-02-02 17:34:32 +01:00
Mike de Boer
f0a7006c0b Bug 1427007 - Part 1: When a SessionWorker is restarted, we also need to re-initialize it with the correct SessionFile data. r=Yoric
We now know that worker restarts are rather frequent and we've had reports that
are certain to point at us forgetting to properly re-initialize the worker.
This takes care of this by factoring the init flow into its own method and setting
the flag when a failing worker is terminated.

MozReview-Commit-ID: G5jccjxkBsF
2018-02-02 16:21:03 +01:00
Dorel Luca
41a45cb10f Backed out 2 changesets (bug 1427007) for failing xpcshell on browser/components/sessionstore/test/unit/test_shutdown_cleanup.js
Backed out changeset 79b25461de35 (bug 1427007)
Backed out changeset 986dab420f52 (bug 1427007)
2018-02-02 18:07:05 +02:00
Mike de Boer
f19ca334f8 Bug 1427007 - Part 2: the SessionFile unit tests dependended on a very specific interaction between wipe() and read(), which changed in part 1. This fixes the tests up by making the dependency a bit more clear and explicit. r=Yoric
MozReview-Commit-ID: KI3qaww77wV
2018-02-02 16:21:07 +01:00
Mike de Boer
20c6ec4cd7 Bug 1427007 - Part 1: When a SessionWorker is restarted, we also need to re-initialize it with the correct SessionFile data. r=Yoric
We now know that worker restarts are rather frequent and we've had reports that
are certain to point at us forgetting to properly re-initialize the worker.
This takes care of this by factoring the init flow into its own method and setting
the flag when a failing worker is terminated.

MozReview-Commit-ID: G5jccjxkBsF
2018-02-02 16:21:03 +01:00
Kris Maglione
0bb74efdf1 Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm

MozReview-Commit-ID: 1Nc3XDu0wGl
2018-01-29 15:20:18 -08:00
Cosmin Sabou
f09d6d985d Backed out 3 changesets (bug 1431533) for Android mochitest failures on testEventDispatcher on a CLOSED TREE
Backed out changeset a1eca62826a1 (bug 1431533)
Backed out changeset 34c999fa006b (bug 1431533)
Backed out changeset e2674287e57f (bug 1431533)
2018-01-30 07:17:48 +02:00
Kris Maglione
fd67f090b2 Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm

MozReview-Commit-ID: 1Nc3XDu0wGl
2018-01-29 15:20:18 -08:00
Brindusan Cristian
483ba301cb Backed out 2 changesets (bug 1431533) for ESlint failures on a CLOSED TREE
Backed out changeset 6e56f4c8843e (bug 1431533)
Backed out changeset 12fc4dee861c (bug 1431533)
2018-01-30 02:32:43 +02:00
Kris Maglione
683a97d172 Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm

MozReview-Commit-ID: 1Nc3XDu0wGl
2018-01-29 15:20:18 -08:00
Mike de Boer
ed65e8c9b2 Bug 1402267 - Add a scalar telemetry probe that tracks SessionFile worker restarts. data-r=liuche, r=chutten,liuche,ttaubert
MozReview-Commit-ID: F3kCfz18kcQ
2017-10-17 12:04:37 +02:00
Mike de Boer
8fb809bc58 Bug 1402267 - Restart the SessionWorker each time there are failures reported as much as defined in the 'browser.sessionstore.max_write_failures' pref. r=ttaubert
MozReview-Commit-ID: 91vOcbmhFmj
2017-10-17 11:59:33 +02:00