function enumerated(namespace, existingDeviceIds, devs) {
    namespacesEnumerated++;
    var lastNamespace = (namespacesEnumerated == self.namespaces_.length);

    if (chrome.runtime.lastError) {
      console.warn(UTIL_fmt('lastError: ' + chrome.runtime.lastError));
      console.log(chrome.runtime.lastError);
      devs = [];
    }

    console.log(UTIL_fmt('Enumerated ' + devs.length + ' gnubbies'));
    console.log(UTIL_fmt(JSON.stringify(devs)));

    var presentDevs = {};
    var deviceIds = [];
    var deviceToDeviceId = self.getDeviceToDeviceId_(namespace);
    for (var i = 0; i < devs.length; ++i) {
      var deviceId = deviceToDeviceId(devs[i]);
      deviceIds.push(deviceId);
      presentDevs[deviceId.device] = devs[i];
    }

    var toRemove = [];
    for (var dev in self.openDevs_[namespace]) {
      if (!presentDevs.hasOwnProperty(dev)) {
        toRemove.push(dev);
      }
    }

    for (var i = 0; i < toRemove.length; i++) {
      dev = toRemove[i];
      if (self.openDevs_[namespace][dev]) {
        self.openDevs_[namespace][dev].destroy();
        delete self.openDevs_[namespace][dev];
      }
    }

    self.devs_[namespace] = devs;
    existingDeviceIds.push.apply(existingDeviceIds, deviceIds);
    if (lastNamespace) {
      while (self.pendingEnumerate.length != 0) {
        var cb = self.pendingEnumerate.shift();
        cb(-GnubbyDevice.OK, existingDeviceIds);
      }
    }
  }
/**
   * @param {string} namespace The namespace that was enumerated.
   * @param {Array<GnubbyDeviceId>} existingDeviceIds Previously enumerated
   *     device IDs (from other namespaces), if any.
   * @param {Array} devs The devices in the namespace.
   */
@param {string} namespace The namespace that was enumerated.
@param {Array} existingDeviceIds Previously enumerated
device IDs (from other namespaces), if any.
@param {Array} devs The devices in the namespace.
@param { string } namespace The namespace that was enumerated . @param { Array } existingDeviceIds Previously enumerated device IDs ( from other namespaces ) if any . @param { Array } devs The devices in the namespace .
function enumerated(namespace, existingDeviceIds, devs) {
    namespacesEnumerated++;
    var lastNamespace = (namespacesEnumerated == self.namespaces_.length);
    if (chrome.runtime.lastError) {
      console.warn(UTIL_fmt('lastError: ' + chrome.runtime.lastError));
      console.log(chrome.runtime.lastError);
      devs = [];
    }
    console.log(UTIL_fmt('Enumerated ' + devs.length + ' gnubbies'));
    console.log(UTIL_fmt(JSON.stringify(devs)));
    var presentDevs = {};
    var deviceIds = [];
    var deviceToDeviceId = self.getDeviceToDeviceId_(namespace);
    for (var i = 0; i < devs.length; ++i) {
      var deviceId = deviceToDeviceId(devs[i]);
      deviceIds.push(deviceId);
      presentDevs[deviceId.device] = devs[i];
    }
    var toRemove = [];
    for (var dev in self.openDevs_[namespace]) {
      if (!presentDevs.hasOwnProperty(dev)) {
        toRemove.push(dev);
      }
    }
    for (var i = 0; i < toRemove.length; i++) {
      dev = toRemove[i];
      if (self.openDevs_[namespace][dev]) {
        self.openDevs_[namespace][dev].destroy();
        delete self.openDevs_[namespace][dev];
      }
    }
    self.devs_[namespace] = devs;
    existingDeviceIds.push.apply(existingDeviceIds, deviceIds);
    if (lastNamespace) {
      while (self.pendingEnumerate.length != 0) {
        var cb = self.pendingEnumerate.shift();
        cb(-GnubbyDevice.OK, existingDeviceIds);
      }
    }
  }
function enumerated ( namespace , existingDeviceIds , devs ) { namespacesEnumerated ++ ; var lastNamespace = ( namespacesEnumerated == self . namespaces_ . length ) ; if ( chrome . runtime . lastError ) { console . warn ( UTIL_fmt ( 'lastError: ' + chrome . runtime . lastError ) ) ; console . log ( chrome . runtime . lastError ) ; devs = [ ] ; } console . log ( UTIL_fmt ( 'Enumerated ' + devs . length + ' gnubbies' ) ) ; console . log ( UTIL_fmt ( JSON . stringify ( devs ) ) ) ; var presentDevs = { } ; var deviceIds = [ ] ; var deviceToDeviceId = self . getDeviceToDeviceId_ ( namespace ) ; for ( var i = 0 ; i < devs . length ; ++ i ) { var deviceId = deviceToDeviceId ( devs [ i ] ) ; deviceIds . push ( deviceId ) ; presentDevs [ deviceId . device ] = devs [ i ] ; } var toRemove = [ ] ; for ( var dev in self . openDevs_ [ namespace ] ) { if ( ! presentDevs . hasOwnProperty ( dev ) ) { toRemove . push ( dev ) ; } } for ( var i = 0 ; i < toRemove . length ; i ++ ) { dev = toRemove [ i ] ; if ( self . openDevs_ [ namespace ] [ dev ] ) { self . openDevs_ [ namespace ] [ dev ] . destroy ( ) ; delete self . openDevs_ [ namespace ] [ dev ] ; } } self . devs_ [ namespace ] = devs ; existingDeviceIds . push . apply ( existingDeviceIds , deviceIds ) ; if ( lastNamespace ) { while ( self . pendingEnumerate . length != 0 ) { var cb = self . pendingEnumerate . shift ( ) ; cb ( - GnubbyDevice . OK , existingDeviceIds ) ; } } }
@param {string} namespace The namespace that was enumerated.
@param { string } namespace The namespace that was enumerated .