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

Unified Diff: Source/modules/webmidi/MIDIOutput.cpp

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/MIDIInput.cpp ('k') | Source/modules/webmidi/MIDIPort.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webmidi/MIDIOutput.cpp
diff --git a/Source/modules/webmidi/MIDIOutput.cpp b/Source/modules/webmidi/MIDIOutput.cpp
index 5d641b98f5200742889c1f42848af7fb251f64ff..94fffbcac1c7127addc9905a9fcc7315af730afc 100644
--- a/Source/modules/webmidi/MIDIOutput.cpp
+++ b/Source/modules/webmidi/MIDIOutput.cpp
@@ -197,6 +197,10 @@ void MIDIOutput::send(DOMUint8Array* array, double timestamp, ExceptionState& ex
if (timestamp == 0.0)
timestamp = now(executionContext());
+ // Implicit open. It does nothing if the port is already opened.
+ // This should be performed even if |array| is invalid.
+ open();
+
if (!array)
return;
« no previous file with comments | « Source/modules/webmidi/MIDIInput.cpp ('k') | Source/modules/webmidi/MIDIPort.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698