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

Side by Side Diff: content/renderer/usb/web_usb_device_impl.h

Issue 1352683006: Move device opening from DeviceManager to Device. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 CONTENT_RENDERER_USB_WEB_USB_DEVICE_IMPL_H_ 5 #ifndef CONTENT_RENDERER_USB_WEB_USB_DEVICE_IMPL_H_
6 #define CONTENT_RENDERER_USB_WEB_USB_DEVICE_IMPL_H_ 6 #define CONTENT_RENDERER_USB_WEB_USB_DEVICE_IMPL_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
11 #include "device/devices_app/usb/public/interfaces/device.mojom.h" 11 #include "device/devices_app/usb/public/interfaces/device.mojom.h"
12 #include "device/devices_app/usb/public/interfaces/device_manager.mojom.h" 12 #include "device/devices_app/usb/public/interfaces/device_manager.mojom.h"
13 #include "mojo/application/public/interfaces/service_provider.mojom.h" 13 #include "mojo/application/public/interfaces/service_provider.mojom.h"
14 #include "third_party/WebKit/public/platform/modules/webusb/WebUSBDevice.h" 14 #include "third_party/WebKit/public/platform/modules/webusb/WebUSBDevice.h"
15 #include "third_party/WebKit/public/platform/modules/webusb/WebUSBDeviceInfo.h" 15 #include "third_party/WebKit/public/platform/modules/webusb/WebUSBDeviceInfo.h"
16 #include "third_party/WebKit/public/platform/modules/webusb/WebUSBError.h" 16 #include "third_party/WebKit/public/platform/modules/webusb/WebUSBError.h"
17 17
18 namespace mojo { 18 namespace mojo {
19 class Shell; 19 class Shell;
20 } 20 }
21 21
22 namespace content { 22 namespace content {
23 23
24 class WebUSBDeviceImpl : public blink::WebUSBDevice { 24 class WebUSBDeviceImpl : public blink::WebUSBDevice {
25 public: 25 public:
26 WebUSBDeviceImpl(device::usb::DeviceManagerPtr device_manager, 26 WebUSBDeviceImpl(device::usb::DevicePtr device,
27 const blink::WebUSBDeviceInfo& device_info); 27 const blink::WebUSBDeviceInfo& device_info);
28 ~WebUSBDeviceImpl() override; 28 ~WebUSBDeviceImpl() override;
29 29
30 private: 30 private:
31 // blink::WebUSBDevice implementation: 31 // blink::WebUSBDevice implementation:
32 const blink::WebUSBDeviceInfo& info() const override; 32 const blink::WebUSBDeviceInfo& info() const override;
33 void open(blink::WebUSBDeviceOpenCallbacks* callbacks) override; 33 void open(blink::WebUSBDeviceOpenCallbacks* callbacks) override;
34 void close(blink::WebUSBDeviceCloseCallbacks* callbacks) override; 34 void close(blink::WebUSBDeviceCloseCallbacks* callbacks) override;
35 void setConfiguration( 35 void setConfiguration(
36 uint8_t configuration_value, 36 uint8_t configuration_value,
(...skipping 17 matching lines...) Expand all
54 unsigned int timeout, 54 unsigned int timeout,
55 blink::WebUSBDeviceControlTransferCallbacks* callbacks) override; 55 blink::WebUSBDeviceControlTransferCallbacks* callbacks) override;
56 void transfer(blink::WebUSBDevice::TransferDirection direction, 56 void transfer(blink::WebUSBDevice::TransferDirection direction,
57 uint8_t endpoint_number, 57 uint8_t endpoint_number,
58 uint8_t* data, 58 uint8_t* data,
59 size_t data_size, 59 size_t data_size,
60 unsigned int timeout, 60 unsigned int timeout,
61 blink::WebUSBDeviceBulkTransferCallbacks* callbacks) override; 61 blink::WebUSBDeviceBulkTransferCallbacks* callbacks) override;
62 void reset(blink::WebUSBDeviceResetCallbacks* callbacks) override; 62 void reset(blink::WebUSBDeviceResetCallbacks* callbacks) override;
63 63
64 device::usb::DeviceManagerPtr device_manager_; 64 device::usb::DevicePtr device_;
65
66 blink::WebUSBDeviceInfo device_info_; 65 blink::WebUSBDeviceInfo device_info_;
67 device::usb::DevicePtr device_;
68 66
69 base::WeakPtrFactory<WebUSBDeviceImpl> weak_factory_; 67 base::WeakPtrFactory<WebUSBDeviceImpl> weak_factory_;
70 68
71 DISALLOW_COPY_AND_ASSIGN(WebUSBDeviceImpl); 69 DISALLOW_COPY_AND_ASSIGN(WebUSBDeviceImpl);
72 }; 70 };
73 71
74 } // namespace content 72 } // namespace content
75 73
76 #endif // CONTENT_RENDERER_USB_WEB_USB_DEVICE_IMPL_H_ 74 #endif // CONTENT_RENDERER_USB_WEB_USB_DEVICE_IMPL_H_
OLDNEW
« no previous file with comments | « content/renderer/usb/web_usb_client_impl.cc ('k') | content/renderer/usb/web_usb_device_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698