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

Side by Side Diff: device/usb/mojo/device_manager_impl.cc

Issue 2062333002: mojo::Callback -> base::Callback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « device/battery/battery_monitor_impl.cc ('k') | mash/app_driver/app_driver.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "device/usb/mojo/device_manager_impl.h" 5 #include "device/usb/mojo/device_manager_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 observer_(this), 44 observer_(this),
45 binding_(this, std::move(request)), 45 binding_(this, std::move(request)),
46 weak_factory_(this) { 46 weak_factory_(this) {
47 // This object owns itself and will be destroyed if the message pipe it is 47 // This object owns itself and will be destroyed if the message pipe it is
48 // bound to is closed, the message loop is destructed, or the UsbService is 48 // bound to is closed, the message loop is destructed, or the UsbService is
49 // shut down. 49 // shut down.
50 observer_.Add(usb_service_); 50 observer_.Add(usb_service_);
51 } 51 }
52 52
53 DeviceManagerImpl::~DeviceManagerImpl() { 53 DeviceManagerImpl::~DeviceManagerImpl() {
54 connection_error_handler_.Run(); 54 if (!connection_error_handler_.is_null())
55 connection_error_handler_.Run();
55 } 56 }
56 57
57 void DeviceManagerImpl::GetDevices(EnumerationOptionsPtr options, 58 void DeviceManagerImpl::GetDevices(EnumerationOptionsPtr options,
58 const GetDevicesCallback& callback) { 59 const GetDevicesCallback& callback) {
59 usb_service_->GetDevices(base::Bind(&DeviceManagerImpl::OnGetDevices, 60 usb_service_->GetDevices(base::Bind(&DeviceManagerImpl::OnGetDevices,
60 weak_factory_.GetWeakPtr(), 61 weak_factory_.GetWeakPtr(),
61 base::Passed(&options), callback)); 62 base::Passed(&options), callback));
62 } 63 }
63 64
64 void DeviceManagerImpl::GetDevice( 65 void DeviceManagerImpl::GetDevice(
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 permission_provider_->HasDevicePermission(device)) 112 permission_provider_->HasDevicePermission(device))
112 client_->OnDeviceRemoved(DeviceInfo::From(*device)); 113 client_->OnDeviceRemoved(DeviceInfo::From(*device));
113 } 114 }
114 115
115 void DeviceManagerImpl::WillDestroyUsbService() { 116 void DeviceManagerImpl::WillDestroyUsbService() {
116 delete this; 117 delete this;
117 } 118 }
118 119
119 } // namespace usb 120 } // namespace usb
120 } // namespace device 121 } // namespace device
OLDNEW
« no previous file with comments | « device/battery/battery_monitor_impl.cc ('k') | mash/app_driver/app_driver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698