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

Unified Diff: device/usb/usb_service.h

Issue 1314273002: Manage UsbService lifetime in DeviceClient implementations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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/usb_device_handle_unittest.cc ('k') | device/usb/usb_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/usb/usb_service.h
diff --git a/device/usb/usb_service.h b/device/usb/usb_service.h
index 8e633d23afcb4bc3ffadf569bdbb5e5b609a3037..dbb837fd2230ff813221d4112cc0335f1d1e5c08 100644
--- a/device/usb/usb_service.h
+++ b/device/usb/usb_service.h
@@ -45,10 +45,12 @@ class UsbService : public base::NonThreadSafe {
};
// The file task runner reference is used for blocking I/O operations.
- // Returns NULL when initialization fails.
- static UsbService* GetInstance(
+ // Returns nullptr when initialization fails.
+ static scoped_ptr<UsbService> Create(
scoped_refptr<base::SequencedTaskRunner> blocking_task_runner);
+ virtual ~UsbService();
+
virtual scoped_refptr<UsbDevice> GetDevice(const std::string& guid) = 0;
// Enumerates available devices.
@@ -59,7 +61,6 @@ class UsbService : public base::NonThreadSafe {
protected:
UsbService();
- virtual ~UsbService();
void NotifyDeviceAdded(scoped_refptr<UsbDevice> device);
void NotifyDeviceRemoved(scoped_refptr<UsbDevice> device);
« no previous file with comments | « device/usb/usb_device_handle_unittest.cc ('k') | device/usb/usb_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698