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

Unified Diff: content/renderer/media/midi_message_filter.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 #7 and #8 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
Index: content/renderer/media/midi_message_filter.cc
diff --git a/content/renderer/media/midi_message_filter.cc b/content/renderer/media/midi_message_filter.cc
index 4ffddad144477f746682d2693f3c1d1c80975cd3..5228bdcdd40dd1e1ea0e24ccfa9f46fb6d9c1310 100644
--- a/content/renderer/media/midi_message_filter.cc
+++ b/content/renderer/media/midi_message_filter.cc
@@ -184,7 +184,7 @@ void MIDIMessageFilter::HandleDataReceived(int port,
#endif
}
-void MIDIMessageFilter::SendMIDIData(int port,
+void MIDIMessageFilter::SendMIDIData(size_t port,
palmer 2013/08/26 17:43:25 Declare this to be uint32_t, and on line 203 also.
Takashi Toyoshima 2013/08/27 07:14:33 Done.
const uint8* data,
size_t length,
double timestamp) {
@@ -200,7 +200,7 @@ void MIDIMessageFilter::SendMIDIData(int port,
port, v, timestamp));
}
-void MIDIMessageFilter::SendMIDIDataOnIOThread(int port,
+void MIDIMessageFilter::SendMIDIDataOnIOThread(size_t port,
const std::vector<uint8>& data,
double timestamp) {
size_t n = data.size();
@@ -215,7 +215,7 @@ void MIDIMessageFilter::SendMIDIDataOnIOThread(int port,
unacknowledged_bytes_sent_ += n;
// Send to the browser.
- Send(new MIDIHostMsg_SendData(port, data, timestamp));
+ Send(new MIDIHostMsg_SendData(static_cast<uint32>(port), data, timestamp));
palmer 2013/08/26 17:43:25 The need for this cast goes away once you declare
Takashi Toyoshima 2013/08/27 07:14:33 Done.
}
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698