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

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: C++11 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
« 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 »
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 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 void Send(IPC::Message* message); 60 void Send(IPC::Message* message);
61 61
62 // IPC::MessageFilter override. Called on |io_message_loop|. 62 // IPC::MessageFilter override. Called on |io_message_loop|.
63 bool OnMessageReceived(const IPC::Message& message) override; 63 bool OnMessageReceived(const IPC::Message& message) override;
64 void OnFilterAdded(IPC::Sender* sender) override; 64 void OnFilterAdded(IPC::Sender* sender) override;
65 void OnFilterRemoved() override; 65 void OnFilterRemoved() override;
66 void OnChannelClosing() override; 66 void OnChannelClosing() override;
67 67
68 // Called when the browser process has approved (or denied) access to 68 // Called when the browser process has approved (or denied) access to
69 // MIDI hardware. 69 // MIDI hardware.
70 // TODO(toyoshim): MidiPortInfoList objects should be notified separately 70 void OnSessionStarted(media::MidiResult result);
71 // port by port. 71
72 void OnSessionStarted(media::MidiResult result, 72 // Called on two cases. One is just before OnSessionStarted() is called to
palmer 2014/10/22 22:55:12 Documentation nit: How about this: These function
Takashi Toyoshima 2014/10/23 07:37:08 Done.
73 media::MidiPortInfoList inputs, 73 // notify initial port information that already exist. The other is to add
74 media::MidiPortInfoList outputs); 74 // new port information when a new device is connected.
75 void OnAddInputPort(media::MidiPortInfo info);
76 void OnAddOutputPort(media::MidiPortInfo info);
75 77
76 // Called when the browser process has sent MIDI data containing one or 78 // Called when the browser process has sent MIDI data containing one or
77 // more messages. 79 // more messages.
78 void OnDataReceived(uint32 port, 80 void OnDataReceived(uint32 port,
79 const std::vector<uint8>& data, 81 const std::vector<uint8>& data,
80 double timestamp); 82 double timestamp);
81 83
82 // From time-to-time, the browser incrementally informs us of how many bytes 84 // From time-to-time, the browser incrementally informs us of how many bytes
83 // it has successfully sent. This is part of our throttling process to avoid 85 // it has successfully sent. This is part of our throttling process to avoid
84 // sending too much data before knowing how much has already been sent. 86 // sending too much data before knowing how much has already been sent.
85 void OnAcknowledgeSentData(size_t bytes_sent); 87 void OnAcknowledgeSentData(size_t bytes_sent);
86 88
87 // Following methods, Handle*, run on |main_message_loop_|. 89 // Following methods, Handle*, run on |main_message_loop_|.
88 void HandleClientAdded(media::MidiResult result); 90 void HandleClientAdded(media::MidiResult result);
89 91
92 void HandleAddInputPort(media::MidiPortInfo info);
93 void HandleAddOutputPort(media::MidiPortInfo info);
94
90 void HandleDataReceived(uint32 port, 95 void HandleDataReceived(uint32 port,
91 const std::vector<uint8>& data, 96 const std::vector<uint8>& data,
92 double timestamp); 97 double timestamp);
93 98
94 void HandleAckknowledgeSentData(size_t bytes_sent); 99 void HandleAckknowledgeSentData(size_t bytes_sent);
95 100
96 // IPC sender for Send(); must only be accessed on |io_message_loop_|. 101 // IPC sender for Send(); must only be accessed on |io_message_loop_|.
97 IPC::Sender* sender_; 102 IPC::Sender* sender_;
98 103
99 // Message loop on which IPC calls are driven. 104 // Message loop on which IPC calls are driven.
(...skipping 22 matching lines...) Expand all
122 media::MidiPortInfoList outputs_; 127 media::MidiPortInfoList outputs_;
123 128
124 size_t unacknowledged_bytes_sent_; 129 size_t unacknowledged_bytes_sent_;
125 130
126 DISALLOW_COPY_AND_ASSIGN(MidiMessageFilter); 131 DISALLOW_COPY_AND_ASSIGN(MidiMessageFilter);
127 }; 132 };
128 133
129 } // namespace content 134 } // namespace content
130 135
131 #endif // CONTENT_RENDERER_MEDIA_MIDI_MESSAGE_FILTER_H_ 136 #endif // CONTENT_RENDERER_MEDIA_MIDI_MESSAGE_FILTER_H_
OLDNEW
« 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