| Index: chrome/browser/resources/cryptotoken/gnubbies.js
|
| diff --git a/chrome/browser/resources/cryptotoken/gnubbies.js b/chrome/browser/resources/cryptotoken/gnubbies.js
|
| index 8424b393a8a2289b81919e05a7bdbe594b5c00e4..eaae1e6383eb8088247812a665a880d58eec4e71 100644
|
| --- a/chrome/browser/resources/cryptotoken/gnubbies.js
|
| +++ b/chrome/browser/resources/cryptotoken/gnubbies.js
|
| @@ -30,11 +30,7 @@ var GnubbyDeviceId;
|
| * @const
|
| * @enum {number}
|
| */
|
| -var GnubbyEnumerationTypes = {
|
| - ANY: 0,
|
| - VID_PID: 1,
|
| - FIDO_U2F: 2
|
| -};
|
| +var GnubbyEnumerationTypes = {ANY: 0, VID_PID: 1, FIDO_U2F: 2};
|
|
|
| /**
|
| * @typedef {{
|
| @@ -87,7 +83,8 @@ Gnubbies.prototype.registerNamespace = function(namespace, impl) {
|
| * @return {boolean} Whether the device is a shared access device.
|
| */
|
| Gnubbies.prototype.isSharedAccess = function(id) {
|
| - if (!this.impl_.hasOwnProperty(id.namespace)) return false;
|
| + if (!this.impl_.hasOwnProperty(id.namespace))
|
| + return false;
|
| return this.impl_[id.namespace].isSharedAccess;
|
| };
|
|
|
| @@ -247,9 +244,8 @@ Gnubbies.prototype.resetInactivityTimer = function(opt_timeoutMillis) {
|
| opt_timeoutMillis + Gnubbies.INACTIVITY_TIMEOUT_MARGIN_MILLIS :
|
| Gnubbies.INACTIVITY_TIMEOUT_MARGIN_MILLIS;
|
| if (!this.inactivityTimer) {
|
| - this.inactivityTimer =
|
| - new CountdownTimer(
|
| - Gnubbies.SYS_TIMER_, millis, this.inactivityTimeout_.bind(this));
|
| + this.inactivityTimer = new CountdownTimer(
|
| + Gnubbies.SYS_TIMER_, millis, this.inactivityTimeout_.bind(this));
|
| } else if (millis > this.inactivityTimer.millisecondsUntilExpired()) {
|
| this.inactivityTimer.clearTimeout();
|
| this.inactivityTimer.setTimeout(millis, this.inactivityTimeout_.bind(this));
|
| @@ -265,7 +261,8 @@ Gnubbies.prototype.inactivityTimeout_ = function() {
|
| for (var namespace in this.openDevs_) {
|
| for (var dev in this.openDevs_[namespace]) {
|
| var deviceId = Number(dev);
|
| - console.warn(namespace + ' device ' + deviceId +
|
| + console.warn(
|
| + namespace + ' device ' + deviceId +
|
| ' still open after inactivity, closing');
|
| this.openDevs_[namespace][deviceId].destroy();
|
| }
|
| @@ -288,10 +285,14 @@ Gnubbies.prototype.addClient = function(which, who, cb) {
|
| if (gnubby.closing) {
|
| // Device is closing or already closed.
|
| self.removeClient(gnubby, who);
|
| - if (cb) { cb(-GnubbyDevice.NODEVICE); }
|
| + if (cb) {
|
| + cb(-GnubbyDevice.NODEVICE);
|
| + }
|
| } else {
|
| gnubby.registerClient(who);
|
| - if (cb) { cb(-GnubbyDevice.OK, gnubby); }
|
| + if (cb) {
|
| + cb(-GnubbyDevice.OK, gnubby);
|
| + }
|
| }
|
| }
|
|
|
| @@ -319,7 +320,9 @@ Gnubbies.prototype.addClient = function(which, who, cb) {
|
| if (!dev) {
|
| // Index out of bounds. Device does not exist in current enumeration.
|
| this.removeClient(null, who);
|
| - if (cb) { cb(-GnubbyDevice.NODEVICE); }
|
| + if (cb) {
|
| + cb(-GnubbyDevice.NODEVICE);
|
| + }
|
| return;
|
| }
|
|
|
|
|