Chromium Code Reviews| 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..8b9a22333331ba0b8cb519f639422175f14b3894 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, |
| + size_t port_index, |
|
palmer
2013/08/26 17:43:25
uint32_t
Takashi Toyoshima
2013/08/27 07:14:33
Done.
|
| + 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 (port_index >= destinations_.size()) |
| 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( |