Chromium Code Reviews| 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 6ed473afeff10538ef4ee2b8fb7db5ce3b5beccb..c20a5b73eaf1233d68e74acbc7bedccc5605a0bb 100644 |
| --- a/content/browser/renderer_host/media/midi_host.cc |
| +++ b/content/browser/renderer_host/media/midi_host.cc |
| @@ -94,6 +94,9 @@ void MIDIHost::OnSendData(int port, |
| if (!midi_manager_) |
| return; |
| + if (data.size() == 0) |
|
scherkus (not reviewing)
2013/08/19 18:08:03
nit: data.empty() ?
Takashi Toyoshima
2013/08/19 18:41:33
Done.
|
| + return; |
| + |
| base::AutoLock auto_lock(in_flight_lock_); |
| // Sanity check that we won't send too much. |
| @@ -107,20 +110,15 @@ void MIDIHost::OnSendData(int port, |
| // TODO(toyoshim): allow System Exclusive if browser has granted |
| // this client access. We'll likely need to pass a GURL |
| // here to compare against our permissions. |
| - if (data.size() > 0 && data[0] >= kSysExMessage) |
| + if (data[0] >= kSysExMessage) |
| return; |
| -#if defined(OS_ANDROID) |
| - // TODO(toyoshim): figure out why data() method does not compile on Android. |
| - NOTIMPLEMENTED(); |
| -#else |
| midi_manager_->DispatchSendMIDIData( |
| this, |
| port, |
| - data.data(), |
| + &data.front(), |
|
scherkus (not reviewing)
2013/08/19 18:08:03
pedantic nit: for consistency you can use &data[0]
Takashi Toyoshima
2013/08/19 18:41:33
Done.
|
| data.size(), |
| timestamp); |
| -#endif |
| sent_bytes_in_flight_ += data.size(); |
| } |