Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5949)

Unified Diff: chrome/browser/resources/cryptotoken/usbgnubbydevice.js

Issue 596083002: Update cryptotoken to 0.8.63 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove a deprecated line Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/cryptotoken/usbgnubbydevice.js
diff --git a/chrome/browser/resources/cryptotoken/usbgnubbydevice.js b/chrome/browser/resources/cryptotoken/usbgnubbydevice.js
index 089ca1543ba3c67fbf643d82f4417459f5dd59d0..5ee13caa8926b2602271cde8707f0ce5265fd8f8 100644
--- a/chrome/browser/resources/cryptotoken/usbgnubbydevice.js
+++ b/chrome/browser/resources/cryptotoken/usbgnubbydevice.js
@@ -77,8 +77,20 @@ UsbGnubbyDevice.prototype.destroy = function() {
this.dev = null;
chrome.usb.releaseInterface(dev, 0, function() {
+ if (chrome.runtime.lastError) {
+ console.warn(UTIL_fmt('Device ' + dev.handle +
+ ' couldn\'t be released:'));
+ console.warn(chrome.runtime.lastError);
+ return;
+ }
console.log(UTIL_fmt('Device ' + dev.handle + ' released'));
chrome.usb.closeDevice(dev, function() {
+ if (chrome.runtime.lastError) {
+ console.warn(UTIL_fmt('Device ' + dev.handle +
+ ' couldn\'t be closed:'));
+ console.warn(chrome.runtime.lastError);
+ return;
+ }
console.log(UTIL_fmt('Device ' + dev.handle + ' closed'));
});
});
@@ -276,8 +288,9 @@ UsbGnubbyDevice.prototype.checkLock_ = function(cid, cmd) {
if (this.lockCID != cid) {
// Some other channel has active lock.
- if (cmd != GnubbyDevice.CMD_SYNC) {
- // Anything but SYNC gets an immediate busy.
+ if (cmd != GnubbyDevice.CMD_SYNC &&
+ cmd != GnubbyDevice.CMD_INIT) {
+ // Anything but SYNC|INIT gets an immediate busy.
var busy = new Uint8Array(
[(cid >> 24) & 255,
(cid >> 16) & 255,
@@ -292,8 +305,9 @@ UsbGnubbyDevice.prototype.checkLock_ = function(cid, cmd) {
return false;
}
- // SYNC gets to go to the device to flush OS tx/rx queues.
- // The usb firmware always responds to SYNC, regardless of lock status.
+ // SYNC|INIT get to go to the device to flush OS tx/rx queues.
+ // The usb firmware is to always respond to SYNC|INIT,
+ // regardless of lock status.
}
}
return true;
@@ -439,7 +453,7 @@ var InterfaceDescriptor;
UsbGnubbyDevice.open = function(gnubbies, which, dev, cb) {
/** @param {chrome.usb.ConnectionHandle=} handle Connection handle */
function deviceOpened(handle) {
- if (!handle) {
+ if (chrome.runtime.lastError) {
console.warn(UTIL_fmt('failed to open device. permissions issue?'));
cb(-GnubbyDevice.NODEVICE);
return;
« no previous file with comments | « chrome/browser/resources/cryptotoken/usbenrollhandler.js ('k') | chrome/browser/resources/cryptotoken/webrequest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698