[Pkg-mozext-commits] [greasemonkey] 14/20: Fix setting up Sync service.
David Prévot
taffit at moszumanska.debian.org
Fri Mar 25 21:37:20 UTC 2016
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository greasemonkey.
commit 87d4e9a912aa46b32c68d866811b8bcd50a4f950
Author: Anthony Lieuallen <arantius at gmail.com>
Date: Fri Mar 4 12:09:57 2016 -0500
Fix setting up Sync service.
Switch from observer on 'weave:service:ready' topic to polling gWeave.Status.ready.
Refs #2335
---
modules/sync.js | 17 ++++-------------
1 file changed, 4 insertions(+), 13 deletions(-)
diff --git a/modules/sync.js b/modules/sync.js
index 4a34cda..53939a1 100644
--- a/modules/sync.js
+++ b/modules/sync.js
@@ -20,7 +20,6 @@ try {
}
-Cu.import('resource://gre/modules/Services.jsm');
Cu.import('resource://gre/modules/XPCOMUtils.jsm');
Cu.import('resource://services-crypto/utils.js');
@@ -38,7 +37,9 @@ var SyncServiceObserver = {
if (gWeave.Status.ready) {
this.initEngine();
} else {
- Services.obs.addObserver(this, 'weave:service:ready', true);
+ // See #2335 -- The 'weave:service:ready' observer has been identified
+ // as unreliable (e10s?). Manually poll instead.
+ GM_util.timeout(GM_util.hitch(SyncServiceObserver, 'init'), 1000);
}
},
@@ -53,17 +54,7 @@ var SyncServiceObserver = {
gWeave.Service.engineManager.register(ScriptEngine);
},
- observe: function(aSubject, aTopic, aData) {
- switch (aTopic) {
- case 'weave:service:ready':
- this.initEngine();
- Services.obs.removeObserver(this, 'weave:service:ready');
- break;
- }
- },
-
- QueryInterface: XPCOMUtils.generateQI(
- [Ci.nsIObserver, Ci.nsISupportsWeakReference]),
+ QueryInterface: XPCOMUtils.generateQI([Ci.nsISupportsWeakReference]),
};
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/greasemonkey.git
More information about the Pkg-mozext-commits
mailing list