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

Side by Side 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: typo on ipc 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 unified diff | Download patch
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 CONTENT_RENDERER_MEDIA_MIDI_MESSAGE_FILTER_H_ 5 #ifndef CONTENT_RENDERER_MEDIA_MIDI_MESSAGE_FILTER_H_
6 #define CONTENT_RENDERER_MEDIA_MIDI_MESSAGE_FILTER_H_ 6 #define CONTENT_RENDERER_MEDIA_MIDI_MESSAGE_FILTER_H_
7 7
8 #include <set> 8 #include <set>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 void Send(IPC::Message* message); 61 void Send(IPC::Message* message);
62 62
63 // IPC::MessageFilter override. Called on |io_message_loop|. 63 // IPC::MessageFilter override. Called on |io_message_loop|.
64 virtual bool OnMessageReceived(const IPC::Message& message) override; 64 virtual bool OnMessageReceived(const IPC::Message& message) override;
65 virtual void OnFilterAdded(IPC::Sender* sender) override; 65 virtual void OnFilterAdded(IPC::Sender* sender) override;
66 virtual void OnFilterRemoved() override; 66 virtual void OnFilterRemoved() override;
67 virtual void OnChannelClosing() override; 67 virtual void OnChannelClosing() override;
68 68
69 // Called when the browser process has approved (or denied) access to 69 // Called when the browser process has approved (or denied) access to
70 // MIDI hardware. 70 // MIDI hardware.
71 // TODO(toyoshim): MidiPortInfoList objects should be notified separately 71 void OnSessionStarted(media::MidiResult result);
72 // port by port. 72
73 void OnSessionStarted(media::MidiResult result, 73 // Called on two cases. One is just before OnSessionStarted() is called to
74 media::MidiPortInfoList inputs, 74 // notify initial port information that already exist. The other is to add
75 media::MidiPortInfoList outputs); 75 // new port information when a new device is connected.
76 void OnAddInputPort(media::MidiPortInfo info);
77 void OnAddOutputPort(media::MidiPortInfo info);
76 78
77 // Called when the browser process has sent MIDI data containing one or 79 // Called when the browser process has sent MIDI data containing one or
78 // more messages. 80 // more messages.
79 void OnDataReceived(uint32 port, 81 void OnDataReceived(uint32 port,
80 const std::vector<uint8>& data, 82 const std::vector<uint8>& data,
81 double timestamp); 83 double timestamp);
82 84
83 // From time-to-time, the browser incrementally informs us of how many bytes 85 // From time-to-time, the browser incrementally informs us of how many bytes
84 // it has successfully sent. This is part of our throttling process to avoid 86 // it has successfully sent. This is part of our throttling process to avoid
85 // sending too much data before knowing how much has already been sent. 87 // sending too much data before knowing how much has already been sent.
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 media::MidiPortInfoList outputs_; 122 media::MidiPortInfoList outputs_;
121 123
122 size_t unacknowledged_bytes_sent_; 124 size_t unacknowledged_bytes_sent_;
123 125
124 DISALLOW_COPY_AND_ASSIGN(MidiMessageFilter); 126 DISALLOW_COPY_AND_ASSIGN(MidiMessageFilter);
125 }; 127 };
126 128
127 } // namespace content 129 } // namespace content
128 130
129 #endif // CONTENT_RENDERER_MEDIA_MIDI_MESSAGE_FILTER_H_ 131 #endif // CONTENT_RENDERER_MEDIA_MIDI_MESSAGE_FILTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698