function _registerEngines() {
    this.engineManager = new EngineManager(this);

    let engines = [];
    // Applications can provide this preference (comma-separated list)
    // to specify which engines should be registered on startup.
    let pref = Svc.Prefs.get("registerEngines");
    if (pref) {
      engines = pref.split(",");
    }

    let declined = [];
    pref = Svc.Prefs.get("declinedEngines");
    if (pref) {
      declined = pref.split(",");
    }

    this.clientsEngine = new ClientEngine(this);

    for (let name of engines) {
      if (!name in ENGINE_MODULES) {
        this._log.info("Do not know about engine: " + name);
        continue;
      }

      let ns = {};
      try {
        Cu.import("resource://services-sync/engines/" + ENGINE_MODULES[name], ns);

        let engineName = name + "Engine";
        if (!(engineName in ns)) {
          this._log.warn("Could not find exported engine instance: " + engineName);
          continue;
        }

        this.engineManager.register(ns[engineName]);
      } catch (ex) {
        this._log.warn("Could not register engine " + name + ": " +
                       CommonUtils.exceptionStr(ex));
      }
    }

    this.engineManager.setDeclined(declined);
  }
/**
   * Register the built-in engines for certain applications
   */
Register the built-in engines for certain applications
Register the built - in engines for certain applications
function _registerEngines() {
    this.engineManager = new EngineManager(this);
    let engines = [];
    let pref = Svc.Prefs.get("registerEngines");
    if (pref) {
      engines = pref.split(",");
    }
    let declined = [];
    pref = Svc.Prefs.get("declinedEngines");
    if (pref) {
      declined = pref.split(",");
    }
    this.clientsEngine = new ClientEngine(this);
    for (let name of engines) {
      if (!name in ENGINE_MODULES) {
        this._log.info("Do not know about engine: " + name);
        continue;
      }
      let ns = {};
      try {
        Cu.import("resource://services-sync/engines/" + ENGINE_MODULES[name], ns);
        let engineName = name + "Engine";
        if (!(engineName in ns)) {
          this._log.warn("Could not find exported engine instance: " + engineName);
          continue;
        }
        this.engineManager.register(ns[engineName]);
      } catch (ex) {
        this._log.warn("Could not register engine " + name + ": " +
                       CommonUtils.exceptionStr(ex));
      }
    }
    this.engineManager.setDeclined(declined);
  }
function _registerEngines ( ) { this . engineManager = new EngineManager ( this ) ; let engines = [ ] ; let pref = Svc . Prefs . get ( "registerEngines" ) ; if ( pref ) { engines = pref . split ( "," ) ; } let declined = [ ] ; pref = Svc . Prefs . get ( "declinedEngines" ) ; if ( pref ) { declined = pref . split ( "," ) ; } this . clientsEngine = new ClientEngine ( this ) ; for ( let name of engines ) { if ( ! name in ENGINE_MODULES ) { this . _log . info ( "Do not know about engine: " + name ) ; continue ; } let ns = { } ; try { Cu . import ( "resource://services-sync/engines/" + ENGINE_MODULES [ name ] , ns ) ; let engineName = name + "Engine" ; if ( ! ( engineName in ns ) ) { this . _log . warn ( "Could not find exported engine instance: " + engineName ) ; continue ; } this . engineManager . register ( ns [ engineName ] ) ; } catch ( ex ) { this . _log . warn ( "Could not register engine " + name + ": " + CommonUtils . exceptionStr ( ex ) ) ; } } this . engineManager . setDeclined ( declined ) ; }
Register the built-in engines for certain applications
Register the built - in engines for certain applications
// Applications can provide this preference (comma-separated list) // to specify which engines should be registered on startup.