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

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

Issue 1060553003: Web MIDI: call AccumulateMidiBytesSent() after operation finished (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test fix: use existing client 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 | « no previous file | media/midi/midi_manager.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 #ifndef MEDIA_MIDI_MIDI_MANAGER_H_ 5 #ifndef MEDIA_MIDI_MIDI_MANAGER_H_
6 #define MEDIA_MIDI_MIDI_MANAGER_H_ 6 #define MEDIA_MIDI_MIDI_MANAGER_H_
7 7
8 #include <set> 8 #include <set>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 // and the client is registered to receive MIDI data. 79 // and the client is registered to receive MIDI data.
80 // CompleteStartSession() is called with MIDI_OK if the session is started. 80 // CompleteStartSession() is called with MIDI_OK if the session is started.
81 // Otherwise CompleteStartSession() is called with proper MidiResult code. 81 // Otherwise CompleteStartSession() is called with proper MidiResult code.
82 // StartSession() and EndSession() can be called on the Chrome_IOThread. 82 // StartSession() and EndSession() can be called on the Chrome_IOThread.
83 // CompleteStartSession() will be invoked on the same Chrome_IOThread. 83 // CompleteStartSession() will be invoked on the same Chrome_IOThread.
84 void StartSession(MidiManagerClient* client); 84 void StartSession(MidiManagerClient* client);
85 85
86 // A client calls EndSession() to stop receiving MIDI data. 86 // A client calls EndSession() to stop receiving MIDI data.
87 void EndSession(MidiManagerClient* client); 87 void EndSession(MidiManagerClient* client);
88 88
89 // Invoke AccumulateMidiBytesSent() for |client| safely. If the session was
90 // already close, do nothing.
yhirano 2015/04/07 12:06:33 closed?
Takashi Toyoshima 2015/04/07 12:50:48 Done.
91 void AccumulateMidiBytesSent(MidiManagerClient* client, size_t n);
92
89 // DispatchSendMidiData() is called when MIDI data should be sent to the MIDI 93 // DispatchSendMidiData() is called when MIDI data should be sent to the MIDI
90 // system. 94 // system.
91 // This method is supposed to return immediately and should not block. 95 // This method is supposed to return immediately and should not block.
92 // |port_index| represents the specific output port from output_ports(). 96 // |port_index| represents the specific output port from output_ports().
93 // |data| represents a series of bytes encoding one or more MIDI messages. 97 // |data| represents a series of bytes encoding one or more MIDI messages.
94 // |length| is the number of bytes in |data|. 98 // |length| is the number of bytes in |data|.
95 // |timestamp| is the time to send the data, in seconds. A value of 0 99 // |timestamp| is the time to send the data, in seconds. A value of 0
96 // means send "now" or as soon as possible. 100 // means send "now" or as soon as possible.
97 // The default implementation is for unsupported platforms. 101 // The default implementation is for unsupported platforms.
98 virtual void DispatchSendMidiData(MidiManagerClient* client, 102 virtual void DispatchSendMidiData(MidiManagerClient* client,
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 // Protects access to |clients_|, |pending_clients_|, |initialized_|, 179 // Protects access to |clients_|, |pending_clients_|, |initialized_|,
176 // |result_|, |input_ports_| and |output_ports_|. 180 // |result_|, |input_ports_| and |output_ports_|.
177 base::Lock lock_; 181 base::Lock lock_;
178 182
179 DISALLOW_COPY_AND_ASSIGN(MidiManager); 183 DISALLOW_COPY_AND_ASSIGN(MidiManager);
180 }; 184 };
181 185
182 } // namespace media 186 } // namespace media
183 187
184 #endif // MEDIA_MIDI_MIDI_MANAGER_H_ 188 #endif // MEDIA_MIDI_MIDI_MANAGER_H_
OLDNEW
« no previous file with comments | « no previous file | media/midi/midi_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698