Chromium Code Reviews| Index: media/midi/midi_manager.cc |
| diff --git a/media/midi/midi_manager.cc b/media/midi/midi_manager.cc |
| index 05fcfa45a96f215af0f079c64717fa8182e0e251..d56a7fc607aa167f5b480b3e9dd766931e922530 100644 |
| --- a/media/midi/midi_manager.cc |
| +++ b/media/midi/midi_manager.cc |
| @@ -6,6 +6,7 @@ |
| #include "base/bind.h" |
| #include "base/bind_helpers.h" |
| +#include "base/message_loop/message_loop.h" |
| #include "base/threading/thread.h" |
| namespace media { |
| @@ -62,10 +63,13 @@ void MIDIManager::ReceiveMIDIData( |
| (*i)->ReceiveMIDIData(port_index, data, length, timestamp); |
| } |
| +bool MIDIManager::CurrentlyOnMIDISendThread() { |
| + return send_thread_->message_loop() == base::MessageLoop::current(); |
| +} |
| + |
| void MIDIManager::DispatchSendMIDIData(MIDIManagerClient* client, |
| - int port_index, |
| - const uint8* data, |
| - size_t length, |
| + unsigned int port_index, |
| + const std::vector<uint8>& data, |
| double timestamp) { |
| // Lazily create the thread when first needed. |
| if (!send_thread_) { |
| @@ -77,7 +81,7 @@ void MIDIManager::DispatchSendMIDIData(MIDIManagerClient* client, |
| send_message_loop_->PostTask( |
| FROM_HERE, |
| base::Bind(&MIDIManager::SendMIDIData, base::Unretained(this), |
| - client, port_index, data, length, timestamp)); |
|
Takashi Toyoshima
2013/08/21 13:48:22
raw buffer could not be passed to another thread c
|
| + client, port_index, data, timestamp)); |
|
scherkus (not reviewing)
2013/08/21 17:46:29
do you know how large |data| can typically be?
ar
Takashi Toyoshima
2013/08/22 05:47:45
Typically, it's just 3 Bytes.
|
| } |
| } // namespace media |