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

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

Issue 16316004: Separate usb device handle from usb device. (deprecate) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Windows compile and a bug. Created 7 years, 6 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 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/memory/linked_ptr.h" 11 #include "base/memory/linked_ptr.h"
12 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
13 #include "base/synchronization/lock.h" 13 #include "base/synchronization/lock.h"
14 #include "chrome/browser/extensions/api/api_resource.h" 14 #include "chrome/browser/extensions/api/api_resource.h"
15 #include "chrome/browser/usb/usb_device.h" 15 #include "chrome/browser/usb/usb_device_handle.h"
16 #include "chrome/common/extensions/api/usb.h" 16 #include "chrome/common/extensions/api/usb.h"
17 17
18 class UsbDevice; 18 class UsbDeviceHandle;
19 19
20 namespace net { 20 namespace net {
21 class IOBuffer; 21 class IOBuffer;
22 } // namespace net 22 } // namespace net
23 23
24 namespace extensions { 24 namespace extensions {
25 25
26 // A UsbDeviceResource is an ApiResource wrapper for a UsbDevice. 26 // A UsbDeviceResource is an ApiResource wrapper for a UsbDevice.
27 class UsbDeviceResource : public ApiResource { 27 class UsbDeviceResource : public ApiResource {
28 public: 28 public:
29 UsbDeviceResource(const std::string& owner_extension_id, 29 UsbDeviceResource(const std::string& owner_extension_id,
30 scoped_refptr<UsbDevice> device); 30 scoped_refptr<UsbDeviceHandle> device);
31 virtual ~UsbDeviceResource(); 31 virtual ~UsbDeviceResource();
32 32
33 scoped_refptr<UsbDevice> device() { 33 scoped_refptr<UsbDeviceHandle> device() {
34 return device_; 34 return device_;
35 } 35 }
36 36
37 private: 37 private:
38 scoped_refptr<UsbDevice> device_; 38 scoped_refptr<UsbDeviceHandle> device_;
39 39
40 DISALLOW_COPY_AND_ASSIGN(UsbDeviceResource); 40 DISALLOW_COPY_AND_ASSIGN(UsbDeviceResource);
41 }; 41 };
42 42
43 } // namespace extensions 43 } // namespace extensions
44 44
45 #endif // CHROME_BROWSER_EXTENSIONS_API_USB_USB_DEVICE_RESOURCE_H_ 45 #endif // CHROME_BROWSER_EXTENSIONS_API_USB_USB_DEVICE_RESOURCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698