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

Side by Side Diff: third_party/WebKit/Source/modules/webusb/USB.h

Issue 2234443002: Mojo C++ binding: make device/usb mojom targets use STD string/vector types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move the vector converter into a private header. Created 4 years, 4 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 USB_h 5 #ifndef USB_h
6 #define USB_h 6 #define USB_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 "core/dom/ContextLifecycleObserver.h" 10 #include "core/dom/ContextLifecycleObserver.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 ExecutionContext* getExecutionContext() const override; 49 ExecutionContext* getExecutionContext() const override;
50 const AtomicString& interfaceName() const override; 50 const AtomicString& interfaceName() const override;
51 51
52 // ContextLifecycleObserver overrides. 52 // ContextLifecycleObserver overrides.
53 void contextDestroyed() override; 53 void contextDestroyed() override;
54 54
55 USBDevice* getOrCreateDevice(device::usb::blink::DeviceInfoPtr); 55 USBDevice* getOrCreateDevice(device::usb::blink::DeviceInfoPtr);
56 56
57 device::usb::blink::DeviceManager* deviceManager() const { return m_deviceMa nager.get(); } 57 device::usb::blink::DeviceManager* deviceManager() const { return m_deviceMa nager.get(); }
58 58
59 void onGetDevices(ScriptPromiseResolver*, mojo::WTFArray<device::usb::blink: :DeviceInfoPtr>); 59 void onGetDevices(ScriptPromiseResolver*, Vector<device::usb::blink::DeviceI nfoPtr>);
60 void onGetPermission(ScriptPromiseResolver*, device::usb::blink::DeviceInfoP tr); 60 void onGetPermission(ScriptPromiseResolver*, device::usb::blink::DeviceInfoP tr);
61 61
62 // DeviceManagerClient implementation. 62 // DeviceManagerClient implementation.
63 void OnDeviceAdded(device::usb::blink::DeviceInfoPtr); 63 void OnDeviceAdded(device::usb::blink::DeviceInfoPtr);
64 void OnDeviceRemoved(device::usb::blink::DeviceInfoPtr); 64 void OnDeviceRemoved(device::usb::blink::DeviceInfoPtr);
65 65
66 void onDeviceManagerConnectionError(); 66 void onDeviceManagerConnectionError();
67 void onChooserServiceConnectionError(); 67 void onChooserServiceConnectionError();
68 68
69 DECLARE_VIRTUAL_TRACE(); 69 DECLARE_VIRTUAL_TRACE();
70 70
71 private: 71 private:
72 explicit USB(LocalFrame& frame); 72 explicit USB(LocalFrame& frame);
73 73
74 device::usb::blink::DeviceManagerPtr m_deviceManager; 74 device::usb::blink::DeviceManagerPtr m_deviceManager;
75 HeapHashSet<Member<ScriptPromiseResolver>> m_deviceManagerRequests; 75 HeapHashSet<Member<ScriptPromiseResolver>> m_deviceManagerRequests;
76 device::usb::blink::ChooserServicePtr m_chooserService; 76 device::usb::blink::ChooserServicePtr m_chooserService;
77 HeapHashSet<Member<ScriptPromiseResolver>> m_chooserServiceRequests; 77 HeapHashSet<Member<ScriptPromiseResolver>> m_chooserServiceRequests;
78 mojo::Binding<device::usb::blink::DeviceManagerClient> m_clientBinding; 78 mojo::Binding<device::usb::blink::DeviceManagerClient> m_clientBinding;
79 HeapHashMap<String, WeakMember<USBDevice>> m_deviceCache; 79 HeapHashMap<String, WeakMember<USBDevice>> m_deviceCache;
80 }; 80 };
81 81
82 } // namespace blink 82 } // namespace blink
83 83
84 #endif // USB_h 84 #endif // USB_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698