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

Unified Diff: media/midi/midi_manager.cc

Issue 16025005: Web MIDI API back-end (work-in-progress) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 7 years, 7 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.cc
diff --git a/media/midi/midi_manager.cc b/media/midi/midi_manager.cc
new file mode 100644
index 0000000000000000000000000000000000000000..3d1adc179f9b3a11b77ba4d5ffb031e74bc91008
--- /dev/null
+++ b/media/midi/midi_manager.cc
@@ -0,0 +1,33 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "media/midi/midi_manager.h"
+
+namespace media {
+
+MIDIManager::MIDIManager() {}
+MIDIManager::~MIDIManager() {}
+
+void MIDIManager::AddClient(Client* client) {
+ base::AutoLock auto_lock(clients_lock_);
+ clients_.insert(client);
+};
+
+void MIDIManager::RemoveClient(Client* client) {
+ base::AutoLock auto_lock(clients_lock_);
+ ClientList::iterator i = clients_.find(client);
+ clients_.erase(i);
+};
+
+void MIDIManager::ReceiveMIDIData(
+ int port_index,
+ const uint8* data,
+ size_t length,
+ double time_stamp) {
+ base::AutoLock auto_lock(clients_lock_);
+ for (ClientList::iterator i = clients_.begin(); i != clients_.end(); ++i)
+ (*i)->ReceiveMIDIData(port_index, data, length, time_stamp);
+};
+
+} // namespace media

Powered by Google App Engine
This is Rietveld 408576698