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

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

Issue 1510313002: Fix crash with MIDI send for MidiManagerAlsa (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2526
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 unified diff | Download patch
« no previous file with comments | « no previous file | media/midi/midi_manager_alsa.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/metrics/histogram_macros.h" 9 #include "base/metrics/histogram_macros.h"
10 #include "base/trace_event/trace_event.h" 10 #include "base/trace_event/trace_event.h"
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 ReportUsage(Usage::SESSION_ENDED); 127 ReportUsage(Usage::SESSION_ENDED);
128 128
129 // At this point, |client| can be in the destruction process, and calling 129 // At this point, |client| can be in the destruction process, and calling
130 // any method of |client| is dangerous. 130 // any method of |client| is dangerous.
131 base::AutoLock auto_lock(lock_); 131 base::AutoLock auto_lock(lock_);
132 clients_.erase(client); 132 clients_.erase(client);
133 pending_clients_.erase(client); 133 pending_clients_.erase(client);
134 } 134 }
135 135
136 void MidiManager::AccumulateMidiBytesSent(MidiManagerClient* client, size_t n) { 136 void MidiManager::AccumulateMidiBytesSent(MidiManagerClient* client, size_t n) {
137 { 137 base::AutoLock auto_lock(lock_);
138 base::AutoLock auto_lock(lock_); 138 if (clients_.find(client) == clients_.end())
139 if (clients_.find(client) == clients_.end()) 139 return;
140 return; 140
141 }
142 client->AccumulateMidiBytesSent(n); 141 client->AccumulateMidiBytesSent(n);
143 } 142 }
144 143
145 void MidiManager::DispatchSendMidiData(MidiManagerClient* client, 144 void MidiManager::DispatchSendMidiData(MidiManagerClient* client,
146 uint32 port_index, 145 uint32 port_index,
147 const std::vector<uint8>& data, 146 const std::vector<uint8>& data,
148 double timestamp) { 147 double timestamp) {
149 NOTREACHED(); 148 NOTREACHED();
150 } 149 }
151 150
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 lock_.AssertAcquired(); 236 lock_.AssertAcquired();
238 237
239 for (const auto& info : input_ports_) 238 for (const auto& info : input_ports_)
240 client->AddInputPort(info); 239 client->AddInputPort(info);
241 for (const auto& info : output_ports_) 240 for (const auto& info : output_ports_)
242 client->AddOutputPort(info); 241 client->AddOutputPort(info);
243 } 242 }
244 243
245 } // namespace midi 244 } // namespace midi
246 } // namespace media 245 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | media/midi/midi_manager_alsa.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698