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

Unified Diff: content/browser/renderer_host/media/midi_host.cc

Issue 23039015: Web MIDI: enable midi_host.cc implementation on Android (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review #4 Created 7 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/media/midi_host.cc
diff --git a/content/browser/renderer_host/media/midi_host.cc b/content/browser/renderer_host/media/midi_host.cc
index 6ed473afeff10538ef4ee2b8fb7db5ce3b5beccb..b0b0e7692f270b4454cb8e26482179dc9b64c040 100644
--- a/content/browser/renderer_host/media/midi_host.cc
+++ b/content/browser/renderer_host/media/midi_host.cc
@@ -94,6 +94,9 @@ void MIDIHost::OnSendData(int port,
if (!midi_manager_)
return;
+ if (data.empty())
+ return;
+
base::AutoLock auto_lock(in_flight_lock_);
// Sanity check that we won't send too much.
@@ -107,20 +110,15 @@ void MIDIHost::OnSendData(int port,
// TODO(toyoshim): allow System Exclusive if browser has granted
// this client access. We'll likely need to pass a GURL
// here to compare against our permissions.
- if (data.size() > 0 && data[0] >= kSysExMessage)
+ if (data[0] >= kSysExMessage)
return;
-#if defined(OS_ANDROID)
- // TODO(toyoshim): figure out why data() method does not compile on Android.
- NOTIMPLEMENTED();
-#else
midi_manager_->DispatchSendMIDIData(
this,
port,
- data.data(),
+ &data[0],
data.size(),
timestamp);
-#endif
sent_bytes_in_flight_ += data.size();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698