[Pkg-mozext-commits] [greasemonkey] 13/20: Sync service small clean ups.
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 11bde85f4f447a9c5cd738717d9f6b99cdcda99f
Author: Anthony Lieuallen <arantius at gmail.com>
Date: Fri Mar 4 12:09:37 2016 -0500
Sync service small clean ups.
---
modules/remoteScript.js | 3 +--
modules/sync.js | 33 +++++++++++++++++----------------
2 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/modules/remoteScript.js b/modules/remoteScript.js
index dddad9e..45d04fe 100644
--- a/modules/remoteScript.js
+++ b/modules/remoteScript.js
@@ -14,7 +14,6 @@ Cu.import("resource://gre/modules/NetUtil.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
-var GM_config = GM_util.getService().config;
var ioService = Cc['@mozilla.org/network/io-service;1']
.getService(Ci.nsIIOService);
@@ -362,7 +361,7 @@ RemoteScript.prototype.install = function(aOldScript, aOnlyDependencies) {
stringBundle.GetStringFromName('remotescript.name-unknown'));
}
- GM_config.install(this.script, aOldScript, this._tempDir);
+ GM_util.getService().config.install(this.script, aOldScript, this._tempDir);
var suffix = 0;
var file = GM_util.scriptDir();
diff --git a/modules/sync.js b/modules/sync.js
index 5e721ad..4a34cda 100644
--- a/modules/sync.js
+++ b/modules/sync.js
@@ -6,22 +6,10 @@ var Cu = Components.utils;
(function initSync() {
-
-Cu.import('resource://gre/modules/Services.jsm');
-Cu.import('resource://gre/modules/XPCOMUtils.jsm');
-Cu.import('resource://services-crypto/utils.js');
-Cu.import("chrome://greasemonkey-modules/content/miscapis.js");
-Cu.import('chrome://greasemonkey-modules/content/prefmanager.js');
-Cu.import("chrome://greasemonkey-modules/content/storageBack.js");
-Cu.import('chrome://greasemonkey-modules/content/util.js');
-
-
-var gSyncInitialized = false;
-
+var gWeave = {};
try {
// The files we're trying to import below don't exist in Firefox builds
// without sync service, causing the import to throw.
- var gWeave = {};
Cu.import('resource://services-sync/engines.js', gWeave);
Cu.import('resource://services-sync/record.js', gWeave);
Cu.import('resource://services-sync/status.js', gWeave);
@@ -31,6 +19,20 @@ try {
return;
}
+
+Cu.import('resource://gre/modules/Services.jsm');
+Cu.import('resource://gre/modules/XPCOMUtils.jsm');
+Cu.import('resource://services-crypto/utils.js');
+
+Cu.import("chrome://greasemonkey-modules/content/miscapis.js");
+Cu.import('chrome://greasemonkey-modules/content/prefmanager.js');
+Cu.import('chrome://greasemonkey-modules/content/remoteScript.js');
+Cu.import("chrome://greasemonkey-modules/content/storageBack.js");
+Cu.import('chrome://greasemonkey-modules/content/util.js');
+
+
+var gSyncInitialized = false;
+
var SyncServiceObserver = {
init: function() {
if (gWeave.Status.ready) {
@@ -44,9 +46,7 @@ var SyncServiceObserver = {
if (gSyncInitialized) return;
gSyncInitialized = true;
- // This must be delayed until after the Greasemonkey service is set up.
- Cu.import('chrome://greasemonkey-modules/content/remoteScript.js');
- // Also delay importing the actual Sync service to prevent conflicts with
+ // Delay importing the actual Sync service to prevent conflicts with
// the master password dialog during browser startup. See #1852.
Cu.import('resource://services-sync/service.js', gWeave);
@@ -57,6 +57,7 @@ var SyncServiceObserver = {
switch (aTopic) {
case 'weave:service:ready':
this.initEngine();
+ Services.obs.removeObserver(this, 'weave:service:ready');
break;
}
},
--
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