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

Unified Diff: chrome/browser/usb/usb_service.h

Issue 10382204: Use a detached platform thread to handle USB events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Minor formatting. Created 8 years, 7 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 | « no previous file | chrome/browser/usb/usb_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/usb/usb_service.h
diff --git a/chrome/browser/usb/usb_service.h b/chrome/browser/usb/usb_service.h
index 18e9791f105627d6ea9b46c68f77ab73dc7960b4..cd8f8863fda540addd5ba443a76ebd410876208c 100644
--- a/chrome/browser/usb/usb_service.h
+++ b/chrome/browser/usb/usb_service.h
@@ -10,11 +10,12 @@
#include <utility>
#include "base/basictypes.h"
-#include "base/threading/thread.h"
+#include "base/threading/platform_thread.h"
#include "chrome/browser/profiles/profile_keyed_service.h"
#include "chrome/browser/usb/usb_device.h"
#include "third_party/libusb/libusb.h"
+class UsbEventHandler;
typedef libusb_context* PlatformUsbContext;
// The USB service handles creating and managing an event handler thread that is
@@ -40,9 +41,6 @@ class UsbService : public ProfileKeyedService {
void CloseDevice(scoped_refptr<UsbDevice> device);
private:
- // Posts a HandleEvent task to the event handling thread.
- void PostHandleEventTask();
-
// Handles a single USB event. If the service is still running after the event
// is handled, posts another HandleEvent callback to the thread.
void HandleEvent();
@@ -51,9 +49,8 @@ class UsbService : public ProfileKeyedService {
// used to free the platform resources associated with the service.
void PlatformShutdown();
- bool running_;
PlatformUsbContext context_;
- base::Thread thread_;
+ UsbEventHandler *event_handler_;
// The devices_ map contains scoped_refptrs to all open devices, indicated by
// their vendor and product id. This allows for reusing an open device without
« no previous file with comments | « no previous file | chrome/browser/usb/usb_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698