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

Unified Diff: content/renderer/media/midi_message_filter.h

Issue 664843002: Web MIDI: distributes MIDIPort information asynchronously (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lifecycle
Patch Set: . => -> Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/media/midi_messages.h ('k') | content/renderer/media/midi_message_filter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/midi_message_filter.h
diff --git a/content/renderer/media/midi_message_filter.h b/content/renderer/media/midi_message_filter.h
index 34cee3d1c26a59f44b9b3cc17e9f03835d203a7a..f7e1a8474a49172d1ab6a8a9a1c481449c9ebc3f 100644
--- a/content/renderer/media/midi_message_filter.h
+++ b/content/renderer/media/midi_message_filter.h
@@ -67,11 +67,15 @@ class CONTENT_EXPORT MidiMessageFilter : public IPC::MessageFilter {
// Called when the browser process has approved (or denied) access to
// MIDI hardware.
- // TODO(toyoshim): MidiPortInfoList objects should be notified separately
- // port by port.
- void OnSessionStarted(media::MidiResult result,
- media::MidiPortInfoList inputs,
- media::MidiPortInfoList outputs);
+ void OnSessionStarted(media::MidiResult result);
+
+ // These functions are called in 2 cases:
+ // (1) Just before calling |OnSessionStarted|, to notify the recipient about
+ // existing ports.
+ // (2) To notify the recipient that a new device was connected and that new
+ // ports have been created.
+ void OnAddInputPort(media::MidiPortInfo info);
+ void OnAddOutputPort(media::MidiPortInfo info);
// Called when the browser process has sent MIDI data containing one or
// more messages.
@@ -87,6 +91,9 @@ class CONTENT_EXPORT MidiMessageFilter : public IPC::MessageFilter {
// Following methods, Handle*, run on |main_message_loop_|.
void HandleClientAdded(media::MidiResult result);
+ void HandleAddInputPort(media::MidiPortInfo info);
+ void HandleAddOutputPort(media::MidiPortInfo info);
+
void HandleDataReceived(uint32 port,
const std::vector<uint8>& data,
double timestamp);
« no previous file with comments | « content/common/media/midi_messages.h ('k') | content/renderer/media/midi_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698