[WebMIDI] Increment in-flight bytes in front of sending data.
commit94cda63b191b7f4546acaca1af8e50928df528b0
authoryhirano@chromium.org <yhirano@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Thu, 6 Feb 2014 11:12:13 +0000 (6 11:12 +0000)
committeryhirano@chromium.org <yhirano@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Thu, 6 Feb 2014 11:12:13 +0000 (6 11:12 +0000)
tree50ea9e133b22b1548466f2487d2da202db3b19a7
parentd6d86722ca25dee3d30cf3e081ed672510ec6bbd
[WebMIDI] Increment in-flight bytes in front of sending data.

If we call AccumulateMIDIBytesSent in MidiManager::DispatchSendData,
it tries to acquire |in_flight_lock_| which is already acquired.
Since recursive locking is not supported by base::Lock in general,
this may result in a deadlock.

This CL fixes it by incrementing |sent_bytes_in_flight_| and releasing the
lock in front of calling DispatchSendData.

BUG=303596
R=toyoshim@chromium.org

Review URL: https://codereview.chromium.org/154153003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@249353 0039d316-1c4b-4281-b951-d872f2087c98
content/browser/renderer_host/media/midi_host.cc