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

Unified Diff: device/usb/mojo/device_impl.cc

Issue 2326913003: Privatize StrongBinding lifetime management (Closed)
Patch Set: rebase Created 4 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
« no previous file with comments | « device/usb/mojo/device_impl.h ('k') | device/usb/mojo/device_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/usb/mojo/device_impl.cc
diff --git a/device/usb/mojo/device_impl.cc b/device/usb/mojo/device_impl.cc
index a10d928189a9171042a608cb1331fb2ae370f21c..4e479c3c440916a50609f90780802d17f4438b72 100644
--- a/device/usb/mojo/device_impl.cc
+++ b/device/usb/mojo/device_impl.cc
@@ -103,7 +103,7 @@ void OnIsochronousTransferOut(
DeviceImpl::DeviceImpl(scoped_refptr<UsbDevice> device,
DeviceInfoPtr device_info,
base::WeakPtr<PermissionProvider> permission_provider,
- mojo::InterfaceRequest<Device> request)
+ DeviceRequest request)
: device_(device),
device_info_(std::move(device_info)),
permission_provider_(permission_provider),
@@ -116,6 +116,8 @@ DeviceImpl::DeviceImpl(scoped_refptr<UsbDevice> device,
// * the message pipe it is bound to is closed or the message loop is
// * destructed.
observer_.Add(device_.get());
+ binding_.set_connection_error_handler(
+ base::Bind([](DeviceImpl* self) { delete self; }, this));
}
DeviceImpl::~DeviceImpl() {
« no previous file with comments | « device/usb/mojo/device_impl.h ('k') | device/usb/mojo/device_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698