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

Unified Diff: media/midi/midi_manager.h

Issue 662853003: Manage MIDI related objects and sessions' lifecycles correctly (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: unittest Created 6 years, 2 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
Index: media/midi/midi_manager.h
diff --git a/media/midi/midi_manager.h b/media/midi/midi_manager.h
index 9fd7a21ed38be1b6715e136fc52cbd6bb5961b12..1e2bcb8dc793ae76ecb5d1787ffb541ec6f9b6f8 100644
--- a/media/midi/midi_manager.h
+++ b/media/midi/midi_manager.h
@@ -5,7 +5,6 @@
#ifndef MEDIA_MIDI_MIDI_MANAGER_H_
#define MEDIA_MIDI_MIDI_MANAGER_H_
-#include <map>
#include <set>
#include <vector>
@@ -32,7 +31,7 @@ class MEDIA_EXPORT MidiManagerClient {
// CompleteStartSession() is called when platform dependent preparation is
// finished.
- virtual void CompleteStartSession(int client_id, MidiResult result) = 0;
+ virtual void CompleteStartSession(MidiResult result) = 0;
// ReceiveMidiData() is called when MIDI data has been received from the
// MIDI system.
@@ -71,7 +70,7 @@ class MEDIA_EXPORT MidiManager {
// Otherwise CompleteStartSession() is called with proper MidiResult code.
// StartSession() and EndSession() can be called on the Chrome_IOThread.
// CompleteStartSession() will be invoked on the same Chrome_IOThread.
- void StartSession(MidiManagerClient* client, int client_id);
+ void StartSession(MidiManagerClient* client);
// A client calls EndSession() to stop receiving MIDI data.
void EndSession(MidiManagerClient* client);
@@ -148,12 +147,11 @@ class MEDIA_EXPORT MidiManager {
void CompleteInitializationInternal(MidiResult result);
// Keeps track of all clients who wish to receive MIDI data.
- typedef std::set<MidiManagerClient*> ClientList;
- ClientList clients_;
+ typedef std::set<MidiManagerClient*> ClientSet;
+ ClientSet clients_;
// Keeps track of all clients who are waiting for CompleteStartSession().
- typedef std::multimap<MidiManagerClient*, int> PendingClientMap;
- PendingClientMap pending_clients_;
+ ClientSet pending_clients_;
// Keeps a SingleThreadTaskRunner of the thread that calls StartSession in
// order to invoke CompleteStartSession() on the thread.

Powered by Google App Engine
This is Rietveld 408576698