WeaveSvc_onStartup: async + async/yield -> sync. Convert chrome callers from using async callback to just run after.
authorEdward Lee <edilee@mozilla.com>
Sat, 06 Jun 2009 18:24:06 -0500
changeset 45542 d8892fbba735130083eaed6af827ca50011503df
parent 45541 39e26c35142b1adf316c82c2d707e682b16d924b
child 45543 aa93742c95d7cec15d5f9dfe90b438046cab4e00
push id14033
push useredward.lee@engineering.uiuc.edu
push dateWed, 23 Jun 2010 22:21:35 +0000
treeherdermozilla-central@227db4ad8cdf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
WeaveSvc_onStartup: async + async/yield -> sync. Convert chrome callers from using async callback to just run after.
services/sync/modules/service.js
--- a/services/sync/modules/service.js
+++ b/services/sync/modules/service.js
@@ -287,18 +287,17 @@ WeaveSvc.prototype = {
   },
 
   onWindowOpened: function WeaveSvc__onWindowOpened() {
   },
 
   // one-time initialization like setting up observers and the like
   // xxx we might need to split some of this out into something we can call
   //     again when username/server/etc changes
-  _onStartup: function WeaveSvc__onStartup() {
-    let self = yield;
+  onStartup: function WeaveSvc_onStartup() {
     this._initLogs();
     this._log.info("Weave " + WEAVE_VERSION + " initializing");
     this._registerEngines();
     this._detailedStatus = new StatusRecord();
 
     // Reset our sync id if we're upgrading, so sync knows to reset local data
     if (WEAVE_VERSION != Svc.Prefs.get("lastversion")) {
       this._log.info("Resetting client syncID from _onStartup.");
@@ -334,20 +333,16 @@ WeaveSvc.prototype = {
     this._genKeyURLs();
 
     if (Svc.Prefs.get("autoconnect") && this.username) {
       try {
         if (this.login())
           this.sync(true);
       } catch (e) {}
     }
-    self.done();
-  },
-  onStartup: function WeaveSvc_onStartup(callback) {
-    this._onStartup.async(this, callback);
   },
 
   _initLogs: function WeaveSvc__initLogs() {
     this._log = Log4Moz.repository.getLogger("Service.Main");
     this._log.level =
       Log4Moz.Level[Svc.Prefs.get("log.logger.service.main")];
 
     let formatter = new Log4Moz.BasicFormatter();