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

Side by Side Diff: device/usb/mock_usb_service.cc

Issue 2482463002: Remove DeviceMonitorLinux::WillDestroyCurrentMessageLoop(). (Closed)
Patch Set: CR achuithb #24 Created 4 years, 1 month 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/test/test_device_client.cc ('k') | device/usb/usb_service.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/mock_usb_service.h" 5 #include "device/usb/mock_usb_service.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "device/usb/usb_device.h" 10 #include "device/usb/usb_device.h"
11 11
12 namespace device { 12 namespace device {
13 13
14 MockUsbService::MockUsbService() : UsbService(nullptr, nullptr) {} 14 MockUsbService::MockUsbService() : UsbService(nullptr, nullptr) {}
15 15
16 MockUsbService::~MockUsbService() { 16 MockUsbService::~MockUsbService() {
17 // Shutdown() must be called before the base class destructor.
18 Shutdown();
17 } 19 }
18 20
19 void MockUsbService::AddDevice(scoped_refptr<UsbDevice> device) { 21 void MockUsbService::AddDevice(scoped_refptr<UsbDevice> device) {
20 devices()[device->guid()] = device; 22 devices()[device->guid()] = device;
21 NotifyDeviceAdded(device); 23 NotifyDeviceAdded(device);
22 } 24 }
23 25
24 void MockUsbService::RemoveDevice(scoped_refptr<UsbDevice> device) { 26 void MockUsbService::RemoveDevice(scoped_refptr<UsbDevice> device) {
25 devices().erase(device->guid()); 27 devices().erase(device->guid());
26 UsbService::NotifyDeviceRemoved(device); 28 UsbService::NotifyDeviceRemoved(device);
27 } 29 }
28 30
29 } // namespace device 31 } // namespace device
OLDNEW
« no previous file with comments | « device/test/test_device_client.cc ('k') | device/usb/usb_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698