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

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

Issue 1500153002: Fix crash with MIDI send for MidiManagerAlsa (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unnecessary base::Unretained 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
« media/midi/midi_manager.cc ('K') | « media/midi/midi_manager.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_alsa.h" 5 #include "media/midi/midi_manager_alsa.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <poll.h> 8 #include <poll.h>
9 #include <stdlib.h> 9 #include <stdlib.h>
10 #include <algorithm> 10 #include <algorithm>
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 delay = std::max(time_to_send - base::TimeTicks::Now(), base::TimeDelta()); 292 delay = std::max(time_to_send - base::TimeTicks::Now(), base::TimeDelta());
293 } 293 }
294 294
295 send_thread_.message_loop()->PostDelayedTask( 295 send_thread_.message_loop()->PostDelayedTask(
296 FROM_HERE, base::Bind(&MidiManagerAlsa::SendMidiData, 296 FROM_HERE, base::Bind(&MidiManagerAlsa::SendMidiData,
297 base::Unretained(this), port_index, data), 297 base::Unretained(this), port_index, data),
298 delay); 298 delay);
299 299
300 // Acknowledge send. 300 // Acknowledge send.
301 send_thread_.message_loop()->PostTask( 301 send_thread_.message_loop()->PostTask(
302 FROM_HERE, base::Bind(&MidiManagerClient::AccumulateMidiBytesSent, 302 FROM_HERE, base::Bind(&MidiManagerAlsa::AccumulateMidiBytesSent,
303 base::Unretained(client), data.size())); 303 base::Unretained(this), client, data.size()));
304 } 304 }
305 305
306 MidiManagerAlsa::MidiPort::Id::Id() = default; 306 MidiManagerAlsa::MidiPort::Id::Id() = default;
307 307
308 MidiManagerAlsa::MidiPort::Id::Id(const std::string& bus, 308 MidiManagerAlsa::MidiPort::Id::Id(const std::string& bus,
309 const std::string& vendor_id, 309 const std::string& vendor_id,
310 const std::string& model_id, 310 const std::string& model_id,
311 const std::string& usb_interface_num, 311 const std::string& usb_interface_num,
312 const std::string& serial) 312 const std::string& serial)
313 : bus_(bus), 313 : bus_(bus),
(...skipping 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after
1344 source_map_[AddrToInt(client_id, port_id)] = port_index; 1344 source_map_[AddrToInt(client_id, port_id)] = port_index;
1345 return true; 1345 return true;
1346 } 1346 }
1347 1347
1348 MidiManager* MidiManager::Create() { 1348 MidiManager* MidiManager::Create() {
1349 return new MidiManagerAlsa(); 1349 return new MidiManagerAlsa();
1350 } 1350 }
1351 1351
1352 } // namespace midi 1352 } // namespace midi
1353 } // namespace media 1353 } // namespace media
OLDNEW
« media/midi/midi_manager.cc ('K') | « media/midi/midi_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698