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

Side by Side Diff: media/midi/midi_manager_usb.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.cc ('k') | media/midi/midi_manager_usb_unittest.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 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_usb.h" 5 #include "media/midi/midi_manager_usb.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 15 matching lines...) Expand all
26 } 26 }
27 27
28 void MidiManagerUsb::StartInitialization() { 28 void MidiManagerUsb::StartInitialization() {
29 Initialize( 29 Initialize(
30 base::Bind(&MidiManager::CompleteInitialization, base::Unretained(this))); 30 base::Bind(&MidiManager::CompleteInitialization, base::Unretained(this)));
31 } 31 }
32 32
33 void MidiManagerUsb::Initialize( 33 void MidiManagerUsb::Initialize(
34 base::Callback<void(MidiResult result)> callback) { 34 base::Callback<void(MidiResult result)> callback) {
35 initialize_callback_ = callback; 35 initialize_callback_ = callback;
36 scheduler_.reset(new MidiScheduler); 36 scheduler_.reset(new MidiScheduler(this));
37 // This is safe because EnumerateDevices cancels the operation on destruction. 37 // This is safe because EnumerateDevices cancels the operation on destruction.
38 device_factory_->EnumerateDevices( 38 device_factory_->EnumerateDevices(
39 this, 39 this,
40 base::Bind(&MidiManagerUsb::OnEnumerateDevicesDone, 40 base::Bind(&MidiManagerUsb::OnEnumerateDevicesDone,
41 base::Unretained(this))); 41 base::Unretained(this)));
42 } 42 }
43 43
44 void MidiManagerUsb::DispatchSendMidiData(MidiManagerClient* client, 44 void MidiManagerUsb::DispatchSendMidiData(MidiManagerClient* client,
45 uint32_t port_index, 45 uint32_t port_index,
46 const std::vector<uint8>& data, 46 const std::vector<uint8>& data,
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 port.id = base::StringPrintf("port-%d-%ld", 157 port.id = base::StringPrintf("port-%d-%ld",
158 device_id, 158 device_id,
159 static_cast<long>(j)); 159 static_cast<long>(j));
160 AddInputPort(port); 160 AddInputPort(port);
161 } 161 }
162 } 162 }
163 return true; 163 return true;
164 } 164 }
165 165
166 } // namespace media 166 } // namespace media
OLDNEW
« no previous file with comments | « media/midi/midi_manager.cc ('k') | media/midi/midi_manager_usb_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698