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

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

Issue 962523005: Web MIDI: add open() and close() to MIDIPort (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: review #14 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/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 33f808ca376279035ccd4db892a64ab91d373787..31dd28d04dba37801fbd95197dcad27aa483e588 100644
--- a/Source/modules/webmidi/MIDIPort.h
+++ b/Source/modules/webmidi/MIDIPort.h
@@ -31,7 +31,9 @@
#ifndef MIDIPort_h
#define MIDIPort_h
+#include "bindings/core/v8/ScriptPromise.h"
#include "modules/EventTargetModules.h"
+#include "modules/webmidi/MIDIAccessor.h"
#include "platform/heap/Handle.h"
namespace blink {
@@ -56,9 +58,12 @@ public:
String type() const;
String version() const { return m_version; }
+ ScriptPromise open(ScriptState*);
+ ScriptPromise close(ScriptState*);
+
MIDIAccess* midiAccess() const { return m_access; }
- bool isActive() const { return m_isActive; }
- void setActiveState(bool isActive);
+ MIDIAccessor::MIDIPortState getState() const { return m_state; }
+ void setState(MIDIAccessor::MIDIPortState);
DECLARE_VIRTUAL_TRACE();
@@ -69,16 +74,19 @@ public:
virtual ExecutionContext* executionContext() const override final;
protected:
- MIDIPort(MIDIAccess*, const String& id, const String& manufacturer, const String& name, MIDIPortTypeCode, const String& version, bool isActive);
+ MIDIPort(MIDIAccess*, const String& id, const String& manufacturer, const String& name, MIDIPortTypeCode, const String& version, MIDIAccessor::MIDIPortState);
private:
+ ScriptPromise accept(ScriptState*);
+ ScriptPromise reject(ScriptState*, const String& name, const String& message);
+
String m_id;
String m_manufacturer;
String m_name;
MIDIPortTypeCode m_type;
String m_version;
Member<MIDIAccess> m_access;
- bool m_isActive;
+ MIDIAccessor::MIDIPortState m_state;
};
} // namespace blink
« 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