OLD | NEW |
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 USBDevice_h | 5 #ifndef USBDevice_h |
6 #define USBDevice_h | 6 #define USBDevice_h |
7 | 7 |
8 #include "bindings/core/v8/ScriptPromise.h" | 8 #include "bindings/core/v8/ScriptPromise.h" |
9 #include "bindings/core/v8/ScriptWrappable.h" | 9 #include "bindings/core/v8/ScriptWrappable.h" |
10 #include "bindings/modules/v8/UnionTypesModules.h" | 10 #include "bindings/modules/v8/UnionTypesModules.h" |
11 #include "core/dom/ContextLifecycleObserver.h" | 11 #include "core/dom/ContextLifecycleObserver.h" |
12 #include "platform/heap/Handle.h" | 12 #include "platform/heap/Handle.h" |
13 #include "public/platform/modules/webusb/WebUSBDevice.h" | 13 #include "public/platform/modules/webusb/WebUSBDevice.h" |
14 #include "public/platform/modules/webusb/WebUSBDeviceInfo.h" | 14 #include "public/platform/modules/webusb/WebUSBDeviceInfo.h" |
15 | 15 |
16 namespace blink { | 16 namespace blink { |
17 | 17 |
18 class ScriptPromiseResolver; | 18 class ScriptPromiseResolver; |
19 class ScriptState; | 19 class ScriptState; |
20 class USBConfiguration; | 20 class USBConfiguration; |
21 class USBControlTransferParameters; | 21 class USBControlTransferParameters; |
22 | 22 |
23 class USBDevice | 23 class USBDevice |
24 : public GarbageCollectedFinalized<USBDevice> | 24 : public GarbageCollectedFinalized<USBDevice> |
25 , public ContextLifecycleObserver | 25 , public ContextLifecycleObserver |
26 , public ScriptWrappable { | 26 , public ScriptWrappable { |
| 27 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(USBDevice); |
27 DEFINE_WRAPPERTYPEINFO(); | 28 DEFINE_WRAPPERTYPEINFO(); |
28 public: | 29 public: |
29 using WebType = OwnPtr<WebUSBDevice>; | 30 using WebType = OwnPtr<WebUSBDevice>; |
30 | 31 |
31 static USBDevice* create(PassOwnPtr<WebUSBDevice> device) | 32 static USBDevice* create(PassOwnPtr<WebUSBDevice> device) |
32 { | 33 { |
33 return new USBDevice(device); | 34 return new USBDevice(device); |
34 } | 35 } |
35 | 36 |
36 static USBDevice* take(ScriptPromiseResolver*, PassOwnPtr<WebUSBDevice> devi
ce) | 37 static USBDevice* take(ScriptPromiseResolver*, PassOwnPtr<WebUSBDevice> devi
ce) |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 | 85 |
85 DECLARE_TRACE(); | 86 DECLARE_TRACE(); |
86 | 87 |
87 private: | 88 private: |
88 OwnPtr<WebUSBDevice> m_device; | 89 OwnPtr<WebUSBDevice> m_device; |
89 }; | 90 }; |
90 | 91 |
91 } // namespace blink | 92 } // namespace blink |
92 | 93 |
93 #endif // USBDevice_h | 94 #endif // USBDevice_h |
OLD | NEW |