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

Unified Diff: content/renderer/media/midi_message_filter.h

Issue 1033603002: Web MIDI: loop style change to be robust (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months 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 | content/renderer/media/midi_message_filter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/midi_message_filter.h
diff --git a/content/renderer/media/midi_message_filter.h b/content/renderer/media/midi_message_filter.h
index 051f315f1f140ee2672bb86c5fcb7947cfac673c..cbad680dd916a3864abfdfd47b39f97f2c01da8f 100644
--- a/content/renderer/media/midi_message_filter.h
+++ b/content/renderer/media/midi_message_filter.h
@@ -126,11 +126,15 @@ class CONTENT_EXPORT MidiMessageFilter : public IPC::MessageFilter {
* Notice: Following members are designed to be accessed only on
* |main_message_loop_|.
*/
- // Keeps track of all MIDI clients.
+ // Keeps track of all MIDI clients. This should be std::set so that various
+ // for-loops work correctly. To change the type, make sure that the new type
+ // is safe to modify the container inside for-loops.
typedef std::set<blink::WebMIDIAccessorClient*> ClientsSet;
ClientsSet clients_;
// Represents clients that are waiting for a session being open.
+ // Note: std::vector is not safe to invoke callbacks inside iterator based
+ // for-loops.
typedef std::vector<blink::WebMIDIAccessorClient*> ClientsQueue;
ClientsQueue clients_waiting_session_queue_;
« no previous file with comments | « no previous file | content/renderer/media/midi_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698