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

Side by Side Diff: media/midi/midi_manager.cc

Issue 1060553003: Web MIDI: call AccumulateMidiBytesSent() after operation finished (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review Created 5 years, 8 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 unified diff | Download patch
« no previous file with comments | « media/midi/midi_manager.h ('k') | media/midi/midi_manager_usb.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/midi/midi_manager.h" 5 #include "media/midi/midi_manager.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/message_loop/message_loop_proxy.h" 9 #include "base/message_loop/message_loop_proxy.h"
10 #include "base/trace_event/trace_event.h" 10 #include "base/trace_event/trace_event.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 } 87 }
88 88
89 void MidiManager::EndSession(MidiManagerClient* client) { 89 void MidiManager::EndSession(MidiManagerClient* client) {
90 // At this point, |client| can be in the destruction process, and calling 90 // At this point, |client| can be in the destruction process, and calling
91 // any method of |client| is dangerous. 91 // any method of |client| is dangerous.
92 base::AutoLock auto_lock(lock_); 92 base::AutoLock auto_lock(lock_);
93 clients_.erase(client); 93 clients_.erase(client);
94 pending_clients_.erase(client); 94 pending_clients_.erase(client);
95 } 95 }
96 96
97 void MidiManager::AccumulateMidiBytesSent(MidiManagerClient* client, size_t n) {
98 {
99 base::AutoLock auto_lock(lock_);
100 if (clients_.find(client) == clients_.end())
101 return;
102 }
103 client->AccumulateMidiBytesSent(n);
104 }
105
97 void MidiManager::DispatchSendMidiData(MidiManagerClient* client, 106 void MidiManager::DispatchSendMidiData(MidiManagerClient* client,
98 uint32 port_index, 107 uint32 port_index,
99 const std::vector<uint8>& data, 108 const std::vector<uint8>& data,
100 double timestamp) { 109 double timestamp) {
101 NOTREACHED(); 110 NOTREACHED();
102 } 111 }
103 112
104 void MidiManager::StartInitialization() { 113 void MidiManager::StartInitialization() {
105 CompleteInitialization(MIDI_NOT_SUPPORTED); 114 CompleteInitialization(MIDI_NOT_SUPPORTED);
106 } 115 }
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 void MidiManager::AddInitialPorts(MidiManagerClient* client) { 188 void MidiManager::AddInitialPorts(MidiManagerClient* client) {
180 lock_.AssertAcquired(); 189 lock_.AssertAcquired();
181 190
182 for (const auto& info : input_ports_) 191 for (const auto& info : input_ports_)
183 client->AddInputPort(info); 192 client->AddInputPort(info);
184 for (const auto& info : output_ports_) 193 for (const auto& info : output_ports_)
185 client->AddOutputPort(info); 194 client->AddOutputPort(info);
186 } 195 }
187 196
188 } // namespace media 197 } // namespace media
OLDNEW
« no previous file with comments | « media/midi/midi_manager.h ('k') | media/midi/midi_manager_usb.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698