Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(778)

Unified Diff: media/midi/midi_manager.cc

Issue 1503213002: Add comment about lock_ in MidiManager::AccumulateMidiBytesSent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/midi/midi_manager.cc
diff --git a/media/midi/midi_manager.cc b/media/midi/midi_manager.cc
index 5fe9f2139f0ff3d325b53a3478cec4b3caad3488..c5ec6559b3cf33c5e940c894a6401bc7c6f7d764 100644
--- a/media/midi/midi_manager.cc
+++ b/media/midi/midi_manager.cc
@@ -153,6 +153,11 @@ void MidiManager::AccumulateMidiBytesSent(MidiManagerClient* client, size_t n) {
if (clients_.find(client) == clients_.end())
return;
+ // Continue to hold lock_ here in case another thread is currently doing
+ // EndSession.
+ // Note that if we are in EndSession, then a destructor is being called and
+ // it isn't really safe to call this method. But we don't have another way to
+ // check this right now.
client->AccumulateMidiBytesSent(n);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698