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

Unified Diff: content/renderer/usb/web_usb_device_impl.cc

Issue 1755683004: Skip attempting to bind a DevicePtr for a removed device. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « content/renderer/usb/web_usb_client_impl.cc ('k') | third_party/WebKit/LayoutTests/usb/usb.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/usb/web_usb_device_impl.cc
diff --git a/content/renderer/usb/web_usb_device_impl.cc b/content/renderer/usb/web_usb_device_impl.cc
index 4182644edaff0e48e1a0201b9e7b94d2ecbce9ff..d5dcf2f17c517cf26bcc7179282816c78a726a17 100644
--- a/content/renderer/usb/web_usb_device_impl.cc
+++ b/content/renderer/usb/web_usb_device_impl.cc
@@ -235,7 +235,8 @@ WebUSBDeviceImpl::WebUSBDeviceImpl(device::usb::DevicePtr device,
: device_(std::move(device)),
device_info_(device_info),
weak_factory_(this) {
- device_.set_connection_error_handler([this]() { device_.reset(); });
+ if (device_)
+ device_.set_connection_error_handler([this]() { device_.reset(); });
}
WebUSBDeviceImpl::~WebUSBDeviceImpl() {}
« no previous file with comments | « content/renderer/usb/web_usb_client_impl.cc ('k') | third_party/WebKit/LayoutTests/usb/usb.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698