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

Side by Side Diff: chrome/browser/extensions/api/usb/usb_device_resource.h

Issue 236203019: Move UsbService to its own component. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move usb_service component symbols into usb_service namespace Created 6 years, 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_EXTENSIONS_API_USB_USB_DEVICE_RESOURCE_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_USB_USB_DEVICE_RESOURCE_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_USB_USB_DEVICE_RESOURCE_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_USB_USB_DEVICE_RESOURCE_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/memory/linked_ptr.h" 12 #include "base/memory/linked_ptr.h"
13 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
14 #include "base/synchronization/lock.h" 14 #include "base/synchronization/lock.h"
15 #include "chrome/browser/usb/usb_device_handle.h"
16 #include "chrome/common/extensions/api/usb.h" 15 #include "chrome/common/extensions/api/usb.h"
16 #include "components/usb_service/usb_device_handle.h"
17 #include "content/public/browser/browser_thread.h" 17 #include "content/public/browser/browser_thread.h"
18 #include "extensions/browser/api/api_resource.h" 18 #include "extensions/browser/api/api_resource.h"
19 #include "extensions/browser/api/api_resource_manager.h" 19 #include "extensions/browser/api/api_resource_manager.h"
20 20
21 class UsbDeviceHandle;
22
23 namespace net { 21 namespace net {
24 class IOBuffer; 22 class IOBuffer;
25 } // namespace net 23 } // namespace net
26 24
27 namespace extensions { 25 namespace extensions {
28 26
29 // A UsbDeviceResource is an ApiResource wrapper for a UsbDevice. 27 // A UsbDeviceResource is an ApiResource wrapper for a UsbDevice.
30 class UsbDeviceResource : public ApiResource { 28 class UsbDeviceResource : public ApiResource {
31 public: 29 public:
32 UsbDeviceResource(const std::string& owner_extension_id, 30 UsbDeviceResource(const std::string& owner_extension_id,
33 scoped_refptr<UsbDeviceHandle> device); 31 scoped_refptr<usb_service::UsbDeviceHandle> device);
34 virtual ~UsbDeviceResource(); 32 virtual ~UsbDeviceResource();
35 33
36 scoped_refptr<UsbDeviceHandle> device() { return device_; } 34 scoped_refptr<usb_service::UsbDeviceHandle> device() { return device_; }
37 35
38 static const content::BrowserThread::ID kThreadId = 36 static const content::BrowserThread::ID kThreadId =
39 content::BrowserThread::FILE; 37 content::BrowserThread::FILE;
40 38
41 private: 39 private:
42 friend class ApiResourceManager<UsbDeviceResource>; 40 friend class ApiResourceManager<UsbDeviceResource>;
43 static const char* service_name() { return "UsbDeviceResourceManager"; } 41 static const char* service_name() { return "UsbDeviceResourceManager"; }
44 42
45 scoped_refptr<UsbDeviceHandle> device_; 43 scoped_refptr<usb_service::UsbDeviceHandle> device_;
46 44
47 DISALLOW_COPY_AND_ASSIGN(UsbDeviceResource); 45 DISALLOW_COPY_AND_ASSIGN(UsbDeviceResource);
48 }; 46 };
49 47
50 } // namespace extensions 48 } // namespace extensions
51 49
52 #endif // CHROME_BROWSER_EXTENSIONS_API_USB_USB_DEVICE_RESOURCE_H_ 50 #endif // CHROME_BROWSER_EXTENSIONS_API_USB_USB_DEVICE_RESOURCE_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/usb/usb_apitest.cc ('k') | chrome/browser/extensions/api/usb/usb_device_resource.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698