diff --git a/services/sync/modules/engines/clients.js b/services/sync/modules/engines/clients.js index d39d628e9a05..30d0d5068412 100644 --- a/services/sync/modules/engines/clients.js +++ b/services/sync/modules/engines/clients.js @@ -96,7 +96,7 @@ ClientStore.prototype = { }, _ClientStore_init: function ClientStore__init() { - this.__proto__.__proto__._init.call(this); + this._init.call(this); this.clients = {}; this.loadSnapshot(); }, diff --git a/services/sync/modules/engines/tabs.js b/services/sync/modules/engines/tabs.js index 25c22a17c23c..cb3c5afdb9f1 100644 --- a/services/sync/modules/engines/tabs.js +++ b/services/sync/modules/engines/tabs.js @@ -50,17 +50,17 @@ Cu.import("resource://weave/constants.js"); Function.prototype.async = Async.sugar; -function TabEngine(pbeId) { - this._init(pbeId); +function TabEngine() { + this._init(); } - TabEngine.prototype = { - __proto__: new BlobEngine(), - - get name() "tabs", - get displayName() { return "Tabs"; }, - get logName() "TabEngine", - get serverPrefix() "user-data/tabs/", + __proto__: SyncEngine.prototype, + name: "tabs", + displayName: "Tabs", + logName: "Tabs", + _storeObj: TabStore, + _trackerObj: TabTracker, + _recordObj: ClientTabsRecord get virtualTabs() { let virtualTabs = {}; @@ -76,28 +76,15 @@ TabEngine.prototype = { } } return virtualTabs; - }, - - get _store() { - let store = new TabStore(); - this.__defineGetter__("_store", function() store); - return this._store; - }, - - get _tracker() { - let tracker = new TabTracker(this); - this.__defineGetter__("_tracker", function() tracker); - return this._tracker; } - }; function TabStore() { - this._init(); + this._TabStore_init(); } TabStore.prototype = { __proto__: new Store(), - _logName: "TabStore", + _logName: "Tabs.Store", get _sessionStore() { let sessionStore = Cc["@mozilla.org/browser/sessionstore;1"]. diff --git a/services/sync/modules/service.js b/services/sync/modules/service.js index a8f27c4e2916..a0e84d794b6f 100644 --- a/services/sync/modules/service.js +++ b/services/sync/modules/service.js @@ -474,10 +474,14 @@ WeaveSvc.prototype = { this._log.debug("Logging in user " + this.username); - yield this.verifyLogin(self.cb, this.username, this.password); - - this._loggedIn = true; - self.done(true); + try { + yield this.verifyLogin(self.cb, this.username, this.password); + this._loggedIn = true; + self.done(true); + } catch (e) { + this._loggedIn = false; + self.done(false); + } }; this._localLock( this._catchAll(