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

Unified Diff: chrome/browser/chrome_device_client.cc

Issue 1312993008: Manage HidService lifetime in DeviceClient implementations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove_usb_service_get_instance
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 | « chrome/browser/chrome_device_client.h ('k') | device/device_tests.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_device_client.cc
diff --git a/chrome/browser/chrome_device_client.cc b/chrome/browser/chrome_device_client.cc
index 0926a1fe9c57151533959b34a7bed99417618a87..e3ffbe733fde7195a53df9d4a155bced8a3def90 100644
--- a/chrome/browser/chrome_device_client.cc
+++ b/chrome/browser/chrome_device_client.cc
@@ -26,6 +26,9 @@ device::UsbService* ChromeDeviceClient::GetUsbService() {
device::HidService* ChromeDeviceClient::GetHidService() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
- return device::HidService::GetInstance(
- BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE));
+ if (!hid_service_) {
+ hid_service_ = device::HidService::Create(
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE));
+ }
+ return hid_service_.get();
}
« no previous file with comments | « chrome/browser/chrome_device_client.h ('k') | device/device_tests.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698