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

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

Issue 1051903002: Web MIDI: implement implicit open() on send() and setOnmidimessage() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: setonmidi..., public Created 5 years, 9 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
Index: Source/modules/webmidi/MIDIPort.h
diff --git a/Source/modules/webmidi/MIDIPort.h b/Source/modules/webmidi/MIDIPort.h
index 12babafdc56aaab9827cad35a03cd99d89fe24f5..755516f3ec5f6173912a109df907c486393b7f5d 100644
--- a/Source/modules/webmidi/MIDIPort.h
+++ b/Source/modules/webmidi/MIDIPort.h
@@ -66,6 +66,7 @@ public:
MIDIAccess* midiAccess() const { return m_access; }
MIDIAccessor::MIDIPortState getState() const { return m_state; }
void setState(MIDIAccessor::MIDIPortState);
+ ConnectionState getConnection() const { return m_connection; }
DECLARE_VIRTUAL_TRACE();
@@ -76,15 +77,17 @@ public:
virtual ExecutionContext* executionContext() const override final;
protected:
- MIDIPort(MIDIAccess*, const String& id, const String& manufacturer, const String& name, TypeCode, const String& version, MIDIAccessor::MIDIPortState);
-
-private:
enum ConnectionState {
ConnectionStateOpen,
ConnectionStateClosed,
ConnectionStatePending
};
+ MIDIPort(MIDIAccess*, const String& id, const String& manufacturer, const String& name, TypeCode, const String& version, MIDIAccessor::MIDIPortState);
+
+ void open();
+
+private:
ScriptPromise accept(ScriptState*);
ScriptPromise reject(ScriptState*, ExceptionCode, const String& message);

Powered by Google App Engine
This is Rietveld 408576698