Index: media/midi/midi_manager_mac.cc |
diff --git a/media/midi/midi_manager_mac.cc b/media/midi/midi_manager_mac.cc |
index 7bc8f2332e02f02fbd32342564fcf0eb933397b5..5d749ba774e0929c263ac01dba4c42b180dbea36 100644 |
--- a/media/midi/midi_manager_mac.cc |
+++ b/media/midi/midi_manager_mac.cc |
@@ -147,10 +147,11 @@ void MIDIManagerMac::ReadMidi(MIDIEndpointRef source, |
} |
void MIDIManagerMac::SendMIDIData(MIDIManagerClient* client, |
- int port_index, |
- const uint8* data, |
- size_t length, |
+ unsigned int port_index, |
+ const std::vector<uint8>& data, |
double timestamp) { |
+ DCHECK(CurrentlyOnMIDISendThread()); |
+ |
// System Exclusive has already been filtered. |
MIDITimeStamp coremidi_timestamp = SecondsToMIDITimeStamp(timestamp); |
@@ -159,14 +160,11 @@ void MIDIManagerMac::SendMIDIData(MIDIManagerClient* client, |
kMaxPacketListSize, |
midi_packet_, |
coremidi_timestamp, |
- length, |
- data); |
+ data.size(), |
+ &data[0]); |
// Lookup the destination based on the port index. |
- // TODO(crogers): re-factor |port_index| to use unsigned |
- // to avoid the need for this check. |
- if (port_index < 0 || |
- static_cast<size_t>(port_index) >= destinations_.size()) |
+ if (static_cast<size_t>(port_index) >= destinations_.size()) |
scherkus (not reviewing)
2013/08/21 17:46:29
if you make port_index size_t, you can remove the
Takashi Toyoshima
2013/08/22 05:47:45
Done.
|
return; |
MIDIEndpointRef destination = destinations_[port_index]; |
@@ -176,7 +174,7 @@ void MIDIManagerMac::SendMIDIData(MIDIManagerClient* client, |
// Re-initialize for next time. |
midi_packet_ = MIDIPacketListInit(packet_list_); |
- client->AccumulateMIDIBytesSent(length); |
+ client->AccumulateMIDIBytesSent(data.size()); |
} |
MIDIPortInfo MIDIManagerMac::GetPortInfoFromEndpoint( |