function _lockedSync() {
    return this._lock("service.js: sync",
                      this._notify("sync", "", function onNotify() {

      let histogram = Services.telemetry.getHistogramById("WEAVE_START_COUNT");
      histogram.add(1);

      let synchronizer = new EngineSynchronizer(this);
      let cb = Async.makeSpinningCallback();
      synchronizer.onComplete = cb;

      synchronizer.sync();
      // wait() throws if the first argument is truthy, which is exactly what
      // we want.
      let result = cb.wait();

      histogram = Services.telemetry.getHistogramById("WEAVE_COMPLETE_SUCCESS_COUNT");
      histogram.add(1);

      // We successfully synchronized. Now let's update our declined engines.
      let meta = this.recordManager.get(this.metaURL);
      if (!meta) {
        this._log.warn("No meta/global; can't update declined state.");
        return;
      }

      let declinedEngines = new DeclinedEngines(this);
      let didChange = declinedEngines.updateDeclined(meta, this.engineManager);
      if (!didChange) {
        this._log.info("No change to declined engines. Not reuploading meta/global.");
        return;
      }

      this.uploadMetaGlobal(meta);
    }))();
  }
/**
   * Sync up engines with the server.
   */
Sync up engines with the server.
Sync up engines with the server .
function _lockedSync() {
    return this._lock("service.js: sync",
                      this._notify("sync", "", function onNotify() {
      let histogram = Services.telemetry.getHistogramById("WEAVE_START_COUNT");
      histogram.add(1);
      let synchronizer = new EngineSynchronizer(this);
      let cb = Async.makeSpinningCallback();
      synchronizer.onComplete = cb;
      synchronizer.sync();
      let result = cb.wait();
      histogram = Services.telemetry.getHistogramById("WEAVE_COMPLETE_SUCCESS_COUNT");
      histogram.add(1);
      let meta = this.recordManager.get(this.metaURL);
      if (!meta) {
        this._log.warn("No meta/global; can't update declined state.");
        return;
      }
      let declinedEngines = new DeclinedEngines(this);
      let didChange = declinedEngines.updateDeclined(meta, this.engineManager);
      if (!didChange) {
        this._log.info("No change to declined engines. Not reuploading meta/global.");
        return;
      }
      this.uploadMetaGlobal(meta);
    }))();
  }
function _lockedSync ( ) { return this . _lock ( "service.js: sync" , this . _notify ( "sync" , "" , function onNotify ( ) { let histogram = Services . telemetry . getHistogramById ( "WEAVE_START_COUNT" ) ; histogram . add ( 1 ) ; let synchronizer = new EngineSynchronizer ( this ) ; let cb = Async . makeSpinningCallback ( ) ; synchronizer . onComplete = cb ; synchronizer . sync ( ) ; let result = cb . wait ( ) ; histogram = Services . telemetry . getHistogramById ( "WEAVE_COMPLETE_SUCCESS_COUNT" ) ; histogram . add ( 1 ) ; let meta = this . recordManager . get ( this . metaURL ) ; if ( ! meta ) { this . _log . warn ( "No meta/global; can't update declined state." ) ; return ; } let declinedEngines = new DeclinedEngines ( this ) ; let didChange = declinedEngines . updateDeclined ( meta , this . engineManager ) ; if ( ! didChange ) { this . _log . info ( "No change to declined engines. Not reuploading meta/global." ) ; return ; } this . uploadMetaGlobal ( meta ) ; } ) ) ( ) ; }
Sync up engines with the server.
Sync up engines with the server .
// wait() throws if the first argument is truthy, which is exactly what // we want. // We successfully synchronized. Now let's update our declined engines.