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

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: kouhei review 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
« no previous file with comments | « Source/modules/webmidi/MIDIOutput.cpp ('k') | Source/modules/webmidi/MIDIPort.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webmidi/MIDIPort.h
diff --git a/Source/modules/webmidi/MIDIPort.h b/Source/modules/webmidi/MIDIPort.h
index 12babafdc56aaab9827cad35a03cd99d89fe24f5..ce828d4f65d5200b55afd668106dd6c96d1b99b8 100644
--- a/Source/modules/webmidi/MIDIPort.h
+++ b/Source/modules/webmidi/MIDIPort.h
@@ -45,6 +45,12 @@ class MIDIPort : public RefCountedGarbageCollectedEventTargetWithInlineData<MIDI
DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollected<MIDIPort>);
DEFINE_WRAPPERTYPEINFO();
public:
+ enum ConnectionState {
+ ConnectionStateOpen,
+ ConnectionStateClosed,
+ ConnectionStatePending
+ };
+
enum TypeCode {
TypeInput,
TypeOutput
@@ -66,6 +72,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();
@@ -78,13 +85,9 @@ public:
protected:
MIDIPort(MIDIAccess*, const String& id, const String& manufacturer, const String& name, TypeCode, const String& version, MIDIAccessor::MIDIPortState);
-private:
- enum ConnectionState {
- ConnectionStateOpen,
- ConnectionStateClosed,
- ConnectionStatePending
- };
+ void open();
+private:
ScriptPromise accept(ScriptState*);
ScriptPromise reject(ScriptState*, ExceptionCode, const String& message);
« no previous file with comments | « Source/modules/webmidi/MIDIOutput.cpp ('k') | Source/modules/webmidi/MIDIPort.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698