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

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

Issue 662233002: Web MIDI: make MidiManagerMac notify device connections (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: it->second Created 5 years, 10 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/renderer/media/midi_message_filter.h ('k') | media/midi/midi_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/midi_message_filter.cc
diff --git a/content/renderer/media/midi_message_filter.cc b/content/renderer/media/midi_message_filter.cc
index 03a9d00001fa81cce9564560219604641281b4d2..258d04d615aee60f892f2e2a72a49a3377b8c206 100644
--- a/content/renderer/media/midi_message_filter.cc
+++ b/content/renderer/media/midi_message_filter.cc
@@ -116,6 +116,8 @@ bool MidiMessageFilter::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(MidiMsg_SessionStarted, OnSessionStarted)
IPC_MESSAGE_HANDLER(MidiMsg_AddInputPort, OnAddInputPort)
IPC_MESSAGE_HANDLER(MidiMsg_AddOutputPort, OnAddOutputPort)
+ IPC_MESSAGE_HANDLER(MidiMsg_SetInputPortState, OnSetInputPortState)
+ IPC_MESSAGE_HANDLER(MidiMsg_SetOutputPortState, OnSetOutputPortState)
IPC_MESSAGE_HANDLER(MidiMsg_DataReceived, OnDataReceived)
IPC_MESSAGE_HANDLER(MidiMsg_AcknowledgeSentData, OnAcknowledgeSentData)
IPC_MESSAGE_UNHANDLED(handled = false)
@@ -163,6 +165,24 @@ void MidiMessageFilter::OnAddOutputPort(media::MidiPortInfo info) {
base::Bind(&MidiMessageFilter::HandleAddOutputPort, this, info));
}
+void MidiMessageFilter::OnSetInputPortState(uint32 port,
+ media::MidiPortState state) {
+ DCHECK(io_message_loop_->BelongsToCurrentThread());
+ main_message_loop_->PostTask(
+ FROM_HERE,
+ base::Bind(&MidiMessageFilter::HandleSetInputPortState,
+ this, port, state));
+}
+
+void MidiMessageFilter::OnSetOutputPortState(uint32 port,
+ media::MidiPortState state) {
+ DCHECK(io_message_loop_->BelongsToCurrentThread());
+ main_message_loop_->PostTask(
+ FROM_HERE,
+ base::Bind(&MidiMessageFilter::HandleSetOutputPortState,
+ this, port, state));
+}
+
void MidiMessageFilter::OnDataReceived(uint32 port,
const std::vector<uint8>& data,
double timestamp) {
@@ -265,4 +285,18 @@ void MidiMessageFilter::HandleAckknowledgeSentData(size_t bytes_sent) {
unacknowledged_bytes_sent_ -= bytes_sent;
}
+void MidiMessageFilter::HandleSetInputPortState(uint32 port,
+ media::MidiPortState state) {
+ DCHECK(main_message_loop_->BelongsToCurrentThread());
+ inputs_[port].state = state;
+ // TODO(toyoshim): Notify to all clients.
+}
+
+void MidiMessageFilter::HandleSetOutputPortState(uint32 port,
+ media::MidiPortState state) {
+ DCHECK(main_message_loop_->BelongsToCurrentThread());
+ outputs_[port].state = state;
+ // TODO(toyoshim): Notify to all clients.
+}
+
} // namespace content
« no previous file with comments | « content/renderer/media/midi_message_filter.h ('k') | media/midi/midi_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698