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

Unified Diff: Source/modules/webusb/USB.cpp

Issue 1291753004: Add onconnect and ondisconnect events to navigator.usb. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update LayoutTests. Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/webusb/USB.h ('k') | Source/modules/webusb/USB.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webusb/USB.cpp
diff --git a/Source/modules/webusb/USB.cpp b/Source/modules/webusb/USB.cpp
index 5acd9acac742004e5bd733717f624432d60d89da..efe5bc72bc4046e328978e37ef379f5bcc25a6a2 100644
--- a/Source/modules/webusb/USB.cpp
+++ b/Source/modules/webusb/USB.cpp
@@ -11,6 +11,7 @@
#include "core/dom/DOMException.h"
#include "core/dom/Document.h"
#include "core/dom/ExceptionCode.h"
+#include "modules/EventTargetModules.h"
#include "modules/webusb/USBDevice.h"
#include "modules/webusb/USBDeviceFilter.h"
#include "modules/webusb/USBDeviceRequestOptions.h"
@@ -108,9 +109,21 @@ ScriptPromise USB::requestDevice(ScriptState* scriptState, const USBDeviceReques
return promise;
}
+ExecutionContext* USB::executionContext() const
+{
+ LocalFrame* frame = m_controller->frame();
+ return frame ? frame->document() : nullptr;
+}
+
+const AtomicString& USB::interfaceName() const
+{
+ return EventTargetNames::USB;
+}
+
DEFINE_TRACE(USB)
{
visitor->trace(m_controller);
+ RefCountedGarbageCollectedEventTargetWithInlineData<USB>::trace(visitor);
}
} // namespace blink
« no previous file with comments | « Source/modules/webusb/USB.h ('k') | Source/modules/webusb/USB.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698