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

Unified Diff: Source/modules/webmidi/MIDIConnectionEvent.h

Issue 943173002: Web MIDI: dispatch MIDIConnectionEvent (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: review #3 Created 5 years, 10 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/webmidi/MIDIAccess.idl ('k') | Source/modules/webmidi/MIDIConnectionEvent.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webmidi/MIDIConnectionEvent.h
diff --git a/Source/modules/webmidi/MIDIConnectionEvent.h b/Source/modules/webmidi/MIDIConnectionEvent.h
index d5f24083964ec79bc94456de519fb9053a48a47d..9d6c25367b296db66dc841546cb3b0f7a89fb768 100644
--- a/Source/modules/webmidi/MIDIConnectionEvent.h
+++ b/Source/modules/webmidi/MIDIConnectionEvent.h
@@ -41,9 +41,20 @@ class MIDIConnectionEventInit;
class MIDIConnectionEvent final : public Event {
DEFINE_WRAPPERTYPEINFO();
public:
- static PassRefPtrWillBeRawPtr<MIDIConnectionEvent> create();
- static PassRefPtrWillBeRawPtr<MIDIConnectionEvent> create(const AtomicString&, MIDIPort*);
- static PassRefPtrWillBeRawPtr<MIDIConnectionEvent> create(const AtomicString&, const MIDIConnectionEventInit&);
+ static PassRefPtrWillBeRawPtr<MIDIConnectionEvent> create()
+ {
+ return adoptRefWillBeNoop(new MIDIConnectionEvent());
+ }
+
+ static PassRefPtrWillBeRawPtr<MIDIConnectionEvent> create(MIDIPort* port)
+ {
+ return adoptRefWillBeNoop(new MIDIConnectionEvent(port));
+ }
+
+ static PassRefPtrWillBeRawPtr<MIDIConnectionEvent> create(const AtomicString& type, const MIDIConnectionEventInit& initializer)
+ {
+ return adoptRefWillBeNoop(new MIDIConnectionEvent(type, initializer));
+ }
MIDIPort* port() { return m_port; }
@@ -52,8 +63,13 @@ public:
DECLARE_VIRTUAL_TRACE();
private:
- MIDIConnectionEvent();
- MIDIConnectionEvent(const AtomicString&, MIDIPort*);
+ MIDIConnectionEvent()
+ : Event(EventTypeNames::statechange, false, false) { }
+
+ MIDIConnectionEvent(MIDIPort* port)
+ : Event(EventTypeNames::statechange, false, false)
+ , m_port(port) { }
+
MIDIConnectionEvent(const AtomicString&, const MIDIConnectionEventInit&);
PersistentWillBeMember<MIDIPort> m_port;
« no previous file with comments | « Source/modules/webmidi/MIDIAccess.idl ('k') | Source/modules/webmidi/MIDIConnectionEvent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698