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

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

Issue 23379002: Web MIDI: fix multi-threading problem around message buffer handling (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review #12 (for submmit) 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 | « content/browser/renderer_host/media/midi_host.h ('k') | content/common/media/midi_messages.h » ('j') | 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 b0b0e7692f270b4454cb8e26482179dc9b64c040..9bf49a5d613fb35dc440aa0265bf5d43124d8ee6 100644
--- a/content/browser/renderer_host/media/midi_host.cc
+++ b/content/browser/renderer_host/media/midi_host.cc
@@ -88,7 +88,7 @@ void MIDIHost::OnStartSession(int client_id) {
output_ports));
}
-void MIDIHost::OnSendData(int port,
+void MIDIHost::OnSendData(uint32 port,
const std::vector<uint8>& data,
double timestamp) {
if (!midi_manager_)
@@ -111,20 +111,19 @@ void MIDIHost::OnSendData(int port,
// this client access. We'll likely need to pass a GURL
// here to compare against our permissions.
if (data[0] >= kSysExMessage)
- return;
+ return;
midi_manager_->DispatchSendMIDIData(
this,
port,
- &data[0],
- data.size(),
+ data,
timestamp);
sent_bytes_in_flight_ += data.size();
}
void MIDIHost::ReceiveMIDIData(
- int port_index,
+ uint32 port,
const uint8* data,
size_t length,
double timestamp) {
@@ -140,7 +139,7 @@ void MIDIHost::ReceiveMIDIData(
// Send to the renderer.
std::vector<uint8> v(data, data + length);
- Send(new MIDIMsg_DataReceived(port_index, v, timestamp));
+ Send(new MIDIMsg_DataReceived(port, v, timestamp));
}
void MIDIHost::AccumulateMIDIBytesSent(size_t n) {
« no previous file with comments | « content/browser/renderer_host/media/midi_host.h ('k') | content/common/media/midi_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698