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

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

Issue 1912223002: Make new WebUSB implementation more resilient to garbage collection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased again. Created 4 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
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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 45
46 // ContextLifecycleObserver overrides. 46 // ContextLifecycleObserver overrides.
47 void contextDestroyed() override; 47 void contextDestroyed() override;
48 48
49 device::usb::wtf::DeviceManager* deviceManager() const { return m_deviceMana ger.get(); } 49 device::usb::wtf::DeviceManager* deviceManager() const { return m_deviceMana ger.get(); }
50 50
51 void onGetDevices(ScriptPromiseResolver*, mojo::WTFArray<device::usb::wtf::D eviceInfoPtr>); 51 void onGetDevices(ScriptPromiseResolver*, mojo::WTFArray<device::usb::wtf::D eviceInfoPtr>);
52 void onGetPermission(ScriptPromiseResolver*, device::usb::wtf::DeviceInfoPtr ); 52 void onGetPermission(ScriptPromiseResolver*, device::usb::wtf::DeviceInfoPtr );
53 void onDeviceChanges(device::usb::wtf::DeviceChangeNotificationPtr); 53 void onDeviceChanges(device::usb::wtf::DeviceChangeNotificationPtr);
54 54
55 void onDeviceManagerConnectionError();
56 void onChooserServiceConnectionError();
57
55 DECLARE_VIRTUAL_TRACE(); 58 DECLARE_VIRTUAL_TRACE();
56 59
57 private: 60 private:
58 explicit USB(LocalFrame& frame); 61 explicit USB(LocalFrame& frame);
59 62
60 device::usb::wtf::DeviceManagerPtr m_deviceManager; 63 device::usb::wtf::DeviceManagerPtr m_deviceManager;
61 HeapHashSet<Member<ScriptPromiseResolver>> m_deviceManagerRequests; 64 HeapHashSet<Member<ScriptPromiseResolver>> m_deviceManagerRequests;
62 device::usb::wtf::ChooserServicePtr m_chooserService; 65 device::usb::wtf::ChooserServicePtr m_chooserService;
63 HeapHashSet<Member<ScriptPromiseResolver>> m_chooserServiceRequests; 66 HeapHashSet<Member<ScriptPromiseResolver>> m_chooserServiceRequests;
64 }; 67 };
65 68
66 } // namespace blink 69 } // namespace blink
67 70
68 #endif // USB_h 71 #endif // USB_h
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/usb/usbDevice.html ('k') | third_party/WebKit/Source/modules/webusb/USB.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698