B2G/gecko/services/sync/modules/service.js
/**
   * Prepare to initialize the rest of Weave after waiting a little bit
   */
Prepare to initialize the rest of Weave after waiting a little bit
Prepare to initialize the rest of Weave after waiting a little bit
function onStartup() {
    this._migratePrefs();
    ErrorHandler.init();
    this._log = Log4Moz.repository.getLogger("Sync.Service");
    this._log.level =
      Log4Moz.Level[Svc.Prefs.get("log.logger.service.main")];
    this._log.info("Loading Weave " + WEAVE_VERSION);
    this.enabled = true;
    this._registerEngines();
    let ua = Cc["@mozilla.org/network/protocol;1?name=http"].
      getService(Ci.nsIHttpProtocolHandler).userAgent;
    this._log.info(ua);
    if (!this._checkCrypto()) {
      this.enabled = false;
      this._log.info("Could not load the Weave crypto component. Disabling " +
                      "Weave, since it will not work correctly.");
    }
    Svc.Obs.add("weave:service:setup-complete", this);
    Svc.Prefs.observe("engine.", this);
    SyncScheduler.init();
    if (!this.enabled) {
      this._log.info("Firefox Sync disabled.");
    }
    this._updateCachedURLs();
    let status = this._checkSetup();
    if (status != STATUS_DISABLED && status != CLIENT_NOT_CONFIGURED) {
      Svc.Obs.notify("weave:engine:start-tracking");
    }
    Utils.nextTick(function onNextTick() {
      Status.ready = true;
      Svc.Obs.notify("weave:service:ready");
    });
  }
function onStartup ( ) { this . _migratePrefs ( ) ; ErrorHandler . init ( ) ; this . _log = Log4Moz . repository . getLogger ( "Sync.Service" ) ; this . _log . level = Log4Moz . Level [ Svc . Prefs . get ( "log.logger.service.main" ) ] ; this . _log . info ( "Loading Weave " + WEAVE_VERSION ) ; this . enabled = true ; this . _registerEngines ( ) ; let ua = Cc [ "@mozilla.org/network/protocol;1?name=http" ] . getService ( Ci . nsIHttpProtocolHandler ) . userAgent ; this . _log . info ( ua ) ; if ( ! this . _checkCrypto ( ) ) { this . enabled = false ; this . _log . info ( "Could not load the Weave crypto component. Disabling " + "Weave, since it will not work correctly." ) ; } Svc . Obs . add ( "weave:service:setup-complete" , this ) ; Svc . Prefs . observe ( "engine." , this ) ; SyncScheduler . init ( ) ; if ( ! this . enabled ) { this . _log . info ( "Firefox Sync disabled." ) ; } this . _updateCachedURLs ( ) ; let status = this . _checkSetup ( ) ; if ( status != STATUS_DISABLED && status != CLIENT_NOT_CONFIGURED ) { Svc . Obs . notify ( "weave:engine:start-tracking" ) ; } Utils . nextTick ( function onNextTick ( ) { Status . ready = true ; Svc . Obs . notify ( "weave:service:ready" ) ; } ) ; }
Prepare to initialize the rest of Weave after waiting a little bit
Prepare to initialize the rest of Weave after waiting a little bit
// Send an event now that Weave service is ready.  We don't do this // synchronously so that observers can import this module before // registering an observer.