[Pkg-mozext-commits] [tabmixplus] 07/44: Follow up bug 1020831 - Make SessionStore.jsm and SessionFile.jsm share the same run state
David Prévot
taffit at moszumanska.debian.org
Wed Oct 15 02:09:58 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository tabmixplus.
commit 8d1036ce52aa5592434f5777d3b33c519a19141b
Author: onemen <tabmix.onemen at gmail.com>
Date: Thu Oct 2 14:20:27 2014 +0300
Follow up bug 1020831 - Make SessionStore.jsm and SessionFile.jsm share the same run state
---
chrome/content/links/setup.js | 15 +++++++++++----
chrome/content/session/session.js | 19 +++++++++++--------
2 files changed, 22 insertions(+), 12 deletions(-)
diff --git a/chrome/content/links/setup.js b/chrome/content/links/setup.js
index 7024283..4c8bcd1 100644
--- a/chrome/content/links/setup.js
+++ b/chrome/content/links/setup.js
@@ -121,11 +121,18 @@ Tabmix.beforeBrowserInitOnLoad = function() {
// to prevent it from restoring last session or pinned tabs.
let setStateRunning = (willRestore || notRestore) &&
this.firstWindowInSession && !this.isWindowAfterSessionRestore;
+ // RunState exist since Firefox 34, bug 1020831
if (setStateRunning) {
- let STATE_STOPPED = 0;
- let STATE_RUNNING = 1;
- if (SM.SessionStore._loadState == STATE_STOPPED) {
- SM.SessionStore._loadState = STATE_RUNNING;
+ let RunState = SM.SessionStoreGlobal.RunState || {
+ get isStopped() {
+ return SM.SessionStore._loadState == 0; // STATE_STOPPED
+ },
+ setRunning: function() {
+ SM.SessionStore._loadState = 1; // STATE_RUNNING
+ }
+ }
+ if (RunState.isStopped) {
+ RunState.setRunning();
SM.notifyObservers = true;
}
}
diff --git a/chrome/content/session/session.js b/chrome/content/session/session.js
index 3e00ca6..5fcc931 100644
--- a/chrome/content/session/session.js
+++ b/chrome/content/session/session.js
@@ -246,12 +246,16 @@ var TabmixSessionManager = {
return this.prefBranch = Services.prefs.getBranch("extensions.tabmix.sessions.");
},
- get SessionStore() {
- delete this.SessionStore;
+ get SessionStoreGlobal() {
+ delete this.SessionStoreGlobal;
let tmp = {}
Cu.import("resource:///modules/sessionstore/SessionStore.jsm", tmp);
- let global = Cu.getGlobalForObject(tmp.SessionStore);
- return this.SessionStore = global.SessionStoreInternal;
+ return this.SessionStoreGlobal = Cu.getGlobalForObject(tmp.SessionStore);
+ },
+
+ get SessionStore() {
+ delete this.SessionStore;
+ return this.SessionStore = this.SessionStoreGlobal.SessionStoreInternal;
},
// call by Tabmix.beforeSessionStoreInit
@@ -669,6 +673,8 @@ var TabmixSessionManager = {
clearTimeout(this.afterExitPrivateBrowsing);
this.afterExitPrivateBrowsing = null;
}
+ delete this.SessionStoreGlobal;
+ delete this.SessionStore;
}
},
@@ -2908,10 +2914,7 @@ try{
// add __SS_lastSessionWindowID to force SessionStore.restoreLastSession
// to open new window
window.__SS_lastSessionWindowID = "" + Date.now() + Math.random();
- let tmp = {}
- Cu.import("resource:///modules/sessionstore/SessionStore.jsm", tmp);
- let global = Cu.getGlobalForObject(tmp.SessionStore);
- global.LastSession.setState(state);
+ this.SessionStoreGlobal.LastSession.setState(state);
return state;
},
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/tabmixplus.git
More information about the Pkg-mozext-commits
mailing list