Commit Graph

50 Commits

Author SHA1 Message Date
Mike de Boer
acd82282ed 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

--HG--
extra : moz-landing-system : lando
2019-05-28 06:46:53 +00:00
Kris Maglione
e930b89c34 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

--HG--
extra : rebase_source : 359574ee3064c90f33bf36c2ebe3159a24cc8895
extra : histedit_source : b93c8f42808b1599f9122d7842d2c0b3e656a594%2C64a3a4e3359dc889e2ab2b49461bab9e27fc10a7
2019-01-17 10:18:31 -08:00
Mark Banner
691543ee89 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

--HG--
extra : moz-landing-system : lando
2018-08-31 05:59:17 +00:00
Dão Gottwald
5b4e355993 Bug 1369456 - Replace nsSessionStartup.js with SessionStartup.jsm. r=florian
MozReview-Commit-ID: 53Mu4zb9X1C

--HG--
rename : browser/components/sessionstore/nsSessionStartup.js => browser/components/sessionstore/SessionStartup.jsm
extra : rebase_source : 5b4f5c2e45841a5ee9123386e8657d8c262ba416
2018-08-04 13:27:40 +02:00
Mike de Boer
26ee427391 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

--HG--
extra : rebase_source : ceb0a6daa620b08d52e76584e38f313b9a8ee679
2018-07-12 12:56:04 +02:00
Kris Maglione
a7b308c3a2 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

--HG--
extra : rebase_source : cffb1c9762191c579d1397c8169e6e7635d229da
extra : histedit_source : dea59ddd2daaae52069c5faceae9149a4f08dd73
2018-04-24 20:18:09 -07:00
Brian Grinstead
97119973ca 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

--HG--
extra : rebase_source : 971bf99f709b8d2afe300f3693665724f747aa5e
2018-02-27 11:29:59 -08:00
Florian Quèze
682b1ec3b2 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
5dec0e0beb 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

--HG--
extra : rebase_source : d9c41878036c1ef7766ef5e91a7005025bc1d72b
2018-02-06 09:36:57 -08:00
Mike de Boer
b7abed98d9 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

--HG--
extra : rebase_source : 753343359129011528fb8deef5a1a7c055ed6bdc
2018-02-02 17:34:32 +01:00
Mike de Boer
bb4b44b797 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

--HG--
extra : rebase_source : 8ca25f5771294697d1875b09b671de2660ef79d5
2018-02-02 16:21:03 +01:00
Dorel Luca
94c2a48ce5 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
6c99a03a13 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

--HG--
extra : rebase_source : 60b6aad41c4c572ea28403f6869eadff500f1be6
2018-02-02 16:21:07 +01:00
Mike de Boer
3e51cd187b 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

--HG--
extra : rebase_source : 8ca25f5771294697d1875b09b671de2660ef79d5
2018-02-02 16:21:03 +01:00
Kris Maglione
918ed6c474 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

--HG--
extra : source : 12fc4dee861c812fd2bd032c63ef17af61800c70
extra : intermediate-source : 34c999fa006bffe8705cf50c54708aa21a962e62
extra : histedit_source : b2be2c5e5d226e6c347312456a6ae339c1e634b0
2018-01-29 15:20:18 -08:00
Cosmin Sabou
9a65a40178 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
6476f95b13 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

--HG--
extra : source : 12fc4dee861c812fd2bd032c63ef17af61800c70
2018-01-29 15:20:18 -08:00
Brindusan Cristian
af8879d1eb 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
c276bb9375 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

--HG--
extra : rebase_source : c004a023389f1f6bf3d2f3efe93c13d423b23ccd
2018-01-29 15:20:18 -08:00
Mike de Boer
ce114716ab Bug 1402267 - Add a scalar telemetry probe that tracks SessionFile worker restarts. data-r=liuche, r=chutten,liuche,ttaubert
MozReview-Commit-ID: F3kCfz18kcQ

--HG--
extra : rebase_source : 5e1a9f033861e3b42cc27923ba142866c518351c
2017-10-17 12:04:37 +02:00
Mike de Boer
6c7f044a8d 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

--HG--
extra : rebase_source : 5d2a5c99cb921f7495c3c69b79a019dc463b09a6
2017-10-17 11:59:33 +02:00
Dan Banner
7caa92d5d8 Bug 1408777 - Automatically fix instances of missing semicolons in the tree. r=Standard8
MozReview-Commit-ID: Jm8BRgt6mIv
2017-10-15 20:50:39 +01:00
Marco Castelluccio
0abc80eebf Bug 1357517 - Remove or delay Preferences.jsm usage from some browser/components/* files. r=Gijs
--HG--
extra : rebase_source : 8ae926bfde827b9a5323d6fb96dc231d429ab9b0
2017-07-31 13:25:41 +02:00
Carsten "Tomcat" Book
259377b6ab merge mozilla-inbound to mozilla-central a=merge 2017-06-26 13:25:51 +02:00
Florian Quèze
721c3ada5e Bug 1368456 - Remove imports of Promise.jsm from Firefox, r=mconley. 2017-06-23 11:25:18 +02:00
Beekill95
94f94018d4 Bug 934967 - Part 1: Compress session store files using lz4. r=mikedeboer
MozReview-Commit-ID: 6wKLIAglefr

--HG--
extra : rebase_source : 0e7b0fb89e342f70968209623eb0e84ffb41adea
2017-06-08 15:14:18 +07:00
Florian Quèze
5e3539e504 Bug 1353542 - massive script-generated patch converting Task.async and Task.spawn calls, and generators clearly identifiable as tasks, rs=Mossop. 2017-05-12 14:42:39 +02:00
Florian Queze
f935ddc4b3 Bug 1356569 - Remove notifyObservers' last parameter when it is falsy, r=jaws. 2017-04-14 21:51:39 +02:00
Sebastian Hengst
738d097aae Backed out changeset 55f3df15eaa6 (bug 1356569) 2017-04-14 23:39:17 +02:00
Florian Queze
3c564a2b02 Bug 1356569 - Remove notifyObservers' last parameter when it is falsy, r=jaws. 2017-04-14 21:51:39 +02:00
Mark Banner
4acba13973 Bug 1311347 - Enable eslint of browser/components/sessionstore/. Autofix changes. r=jaws
MozReview-Commit-ID: 5LKHbcmjSy

--HG--
extra : rebase_source : d7e4571dae5c5770c7908579d7634419382d78e2
2017-03-10 19:51:20 +00:00
jordan9769
5761e9b0d1 Bug 1311347 - Enable eslint of browser/components/sessionstore/. Initial changes by Sourav, updated by Standard8. r=jaws
MozReview-Commit-ID: 4RFxoV8SkIa

--HG--
extra : rebase_source : 96b24b172cfa957489df37943171ddae07145e84
2016-10-28 02:48:50 +05:30
David Rajchenbach-Teller
1a3a107998 Bug 1251347 - Making sure that SessionFile.write initializes its workers;r=mconley
Bug 1243549 fixed a race condition during SessionFile startup which
could cause calls to SessionFile.write to send messages to the worker
before it was initialized. The fix consisted in waiting until
initialization was complete before proceeding.

As it turns out, there are cases in which we send messages to the
worker without ever attempting to initialize it, so this wait ends up
causing a hang/shutdown.

This patch fixes the issue by making sure that any message sent to the
worker first initializes the worker if it hasn't been initialized
yet. Since initializing the worker requires us reading the session
store files to find out which one is valid, well, we do exactly that.

MozReview-Commit-ID: 1bOgCaF6ahM

--HG--
extra : rebase_source : 5f1c6df24457c37c8b253c9e14d6e2b5eba2bfbb
2016-02-26 12:02:43 +01:00
David Rajchenbach-Teller
9b9c86a59b Bug 1251347 - Refining SessionFile Shutdown hang details;r=me
MozReview-Commit-ID: Jag5oFwKTqr

--HG--
extra : rebase_source : 0e56ccd8755bb97640e7e1ae1df95f4410429df9
2016-02-26 11:11:47 +01:00
David Rajchenbach-Teller
2e0b046d19 Bug 1243549 - SessionFile.wipe() now waits until SessionFile has been properly initialized. r=mconley
While investigating bug 1243549, we encountered several instances of the following error message during each startup:

*************************
A coding exception was thrown and uncaught in a Task.

Full message: TypeError: this.Paths is null
Full stack: Agent.wipe@resource:///modules/sessionstore/SessionWorker.js:296:7
worker.dispatch@resource:///modules/sessionstore/SessionWorker.js:21:24
anonymous/AbstractWorker.prototype.handleMessage@resource://gre/modules/workers/PromiseWorker.js:122:16
@resource:///modules/sessionstore/SessionWorker.js:30:41

*************************

These messages can be explained as follows:

* If sanitization has failed during shutdown, it attempts again to
  sanitize during startup. This happens more often than it used to,
  because of 1/ startup bug fixes in bug 1089695; 2/ new shutdown bugs
  most likely also added by or around bug 1089695.

* Sanitization during startup doesn't wait until Session Restore has
  properly started to sanitize the session. So sanitization of Session
  Restore file fails. This has probably always been the case, except
  we never noticed.

* For some reason I do not understand, it attempts to sanitize several
  times.

* I suspect that this can cause problems during startup, as
  sanitization and Session Restore race to use/remove the files of
  Session Restore.

This patch makes sure that SessionFile.wipe() waits until
initialization of SessionFile is complete before proceeding.
2016-02-02 12:56:11 +01:00
Alexandre Poirot
89cb263b54 Bug 1204812 - Keep Console.jsm in toolkit/modules/ r=jryans,Mossop
--HG--
rename : devtools/shared/Console.jsm => toolkit/modules/Console.jsm
2015-10-15 03:45:22 -07:00
Fabian Furger
b0b92ed59f Bug 1147822 - Add a format version number for sessionstore.js. r=Yoric 2015-10-11 20:24:32 +02:00
J. Ryan Stinnett
efe328f1b2 Bug 912121 - Rewrite require / import to match source tree. rs=devtools
In a following patch, all DevTools moz.build files will use DevToolsModules to
install JS modules at a path that corresponds directly to their source tree
location.  Here we rewrite all require and import calls to match the new
location that these files are installed to.

--HG--
extra : commitid : F2ItGm8ptRz
extra : rebase_source : b082fe4bf77e22e297e303fc601165ceff1c4cbc
2015-09-21 12:04:18 -05:00
Shu-yu Guo
64db2267cf Bug 1202902 - Mass replace toplevel 'let' with 'var' in preparation for global lexical scope. (rs=jorendorff) 2015-09-15 11:19:45 -07:00
David Rajchenbach-Teller
f0a8818555 Bug 1034075 - Add more details to SessionFile AsyncShutdown blocker. r=ttaubert
--HG--
extra : transplant_source : g%96%E37%1CI%07%DD%E2o%1B%BD%A8%F7%C7g-0%8D%CE
2015-05-19 13:53:41 +02:00
Tim Taubert
01f62314ff Bug 1150529 - Remove code for expired telemetry histograms r=Yoric 2015-05-02 09:56:39 +02:00
Tim Taubert
864092309d Bug 1134518 - Cap shistory entries in the SessionWorker when shutting down r=Yoric 2015-04-22 18:41:32 +02:00
Tim Taubert
2720b4d9f6 Bug 1152341 - Failure to read one of the session file candidates shouldn't stop us from trying further r=Yoric 2015-04-15 15:27:12 +02:00
Fabian Furger
70b79ea18f Bug 1107941 - Removing old upgrade backups if too many exist. Max upgrade backups is defined in preferences. Tested with mochi tests. r=Yoric 2015-04-02 17:09:31 +01:00
Tim Taubert
614314a0ee Bug 960959 - Use RunState to keep track of the SessionFile's closed status r=yoric 2014-10-20 13:08:44 +02:00
Iaroslav Sheptykin
4170243a35 Bug 1031298 - Add a histogram for counting unrecoverable sessions. r=yoric 2014-09-25 13:39:00 -04:00
Tim Taubert
f3504d9241 Bug 1020831 - Make SessionStore.jsm and SessionFile.jsm share the same run state r=yoric 2014-09-25 23:26:41 +02:00
Tim Taubert
ac9a92b4bf Bug 1072814 - Fix SessionFile.jsm to use new Promise() API r=yoric 2014-09-25 04:51:37 +02:00
Steven MacLeod
a0a0c45963 Bug 1036341 - Use the existence of any session files to determine if a profile crashed or is fresh. r=ttaubert
--HG--
extra : rebase_source : 15be325a24563254c6d16627cd1de611039356fe
extra : histedit_source : db1e5179d574c0620d446c60848818da14b7ad64%2C6dad046683f375187ca4beda47bea68caa12da9f
2014-08-12 15:38:55 -04:00
Birunthan Mohanathas
da44ab0e02 Bug 1038458 - Part 6: Flatten browser/components/sessionstore/src/ directory. r=mak
--HG--
rename : browser/components/sessionstore/src/ContentRestore.jsm => browser/components/sessionstore/ContentRestore.jsm
rename : browser/components/sessionstore/src/DocShellCapabilities.jsm => browser/components/sessionstore/DocShellCapabilities.jsm
rename : browser/components/sessionstore/src/FrameTree.jsm => browser/components/sessionstore/FrameTree.jsm
rename : browser/components/sessionstore/src/GlobalState.jsm => browser/components/sessionstore/GlobalState.jsm
rename : browser/components/sessionstore/src/PageStyle.jsm => browser/components/sessionstore/PageStyle.jsm
rename : browser/components/sessionstore/src/PrivacyFilter.jsm => browser/components/sessionstore/PrivacyFilter.jsm
rename : browser/components/sessionstore/src/PrivacyLevel.jsm => browser/components/sessionstore/PrivacyLevel.jsm
rename : browser/components/sessionstore/src/RecentlyClosedTabsAndWindowsMenuUtils.jsm => browser/components/sessionstore/RecentlyClosedTabsAndWindowsMenuUtils.jsm
rename : browser/components/sessionstore/src/SessionCookies.jsm => browser/components/sessionstore/SessionCookies.jsm
rename : browser/components/sessionstore/src/SessionFile.jsm => browser/components/sessionstore/SessionFile.jsm
rename : browser/components/sessionstore/src/SessionHistory.jsm => browser/components/sessionstore/SessionHistory.jsm
rename : browser/components/sessionstore/src/SessionMigration.jsm => browser/components/sessionstore/SessionMigration.jsm
rename : browser/components/sessionstore/src/SessionSaver.jsm => browser/components/sessionstore/SessionSaver.jsm
rename : browser/components/sessionstore/src/SessionStorage.jsm => browser/components/sessionstore/SessionStorage.jsm
rename : browser/components/sessionstore/src/SessionStore.jsm => browser/components/sessionstore/SessionStore.jsm
rename : browser/components/sessionstore/src/SessionWorker.js => browser/components/sessionstore/SessionWorker.js
rename : browser/components/sessionstore/src/SessionWorker.jsm => browser/components/sessionstore/SessionWorker.jsm
rename : browser/components/sessionstore/src/TabAttributes.jsm => browser/components/sessionstore/TabAttributes.jsm
rename : browser/components/sessionstore/src/TabState.jsm => browser/components/sessionstore/TabState.jsm
rename : browser/components/sessionstore/src/TabStateCache.jsm => browser/components/sessionstore/TabStateCache.jsm
rename : browser/components/sessionstore/src/Utils.jsm => browser/components/sessionstore/Utils.jsm
rename : browser/components/sessionstore/src/nsSessionStartup.js => browser/components/sessionstore/nsSessionStartup.js
rename : browser/components/sessionstore/src/nsSessionStore.js => browser/components/sessionstore/nsSessionStore.js
rename : browser/components/sessionstore/src/nsSessionStore.manifest => browser/components/sessionstore/nsSessionStore.manifest
2014-07-26 09:32:08 -07:00