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

Side by Side Diff: content/renderer/media/midi_message_filter.cc

Issue 2349713003: IPC::MessageFilter::OnFilterAdded: IPC::Sender -> IPC::Channel (Closed)
Patch Set: . Created 4 years, 3 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 #include "content/renderer/media/midi_message_filter.h" 5 #include "content/renderer/media/midi_message_filter.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 IPC_MESSAGE_HANDLER(MidiMsg_AddOutputPort, OnAddOutputPort) 118 IPC_MESSAGE_HANDLER(MidiMsg_AddOutputPort, OnAddOutputPort)
119 IPC_MESSAGE_HANDLER(MidiMsg_SetInputPortState, OnSetInputPortState) 119 IPC_MESSAGE_HANDLER(MidiMsg_SetInputPortState, OnSetInputPortState)
120 IPC_MESSAGE_HANDLER(MidiMsg_SetOutputPortState, OnSetOutputPortState) 120 IPC_MESSAGE_HANDLER(MidiMsg_SetOutputPortState, OnSetOutputPortState)
121 IPC_MESSAGE_HANDLER(MidiMsg_DataReceived, OnDataReceived) 121 IPC_MESSAGE_HANDLER(MidiMsg_DataReceived, OnDataReceived)
122 IPC_MESSAGE_HANDLER(MidiMsg_AcknowledgeSentData, OnAcknowledgeSentData) 122 IPC_MESSAGE_HANDLER(MidiMsg_AcknowledgeSentData, OnAcknowledgeSentData)
123 IPC_MESSAGE_UNHANDLED(handled = false) 123 IPC_MESSAGE_UNHANDLED(handled = false)
124 IPC_END_MESSAGE_MAP() 124 IPC_END_MESSAGE_MAP()
125 return handled; 125 return handled;
126 } 126 }
127 127
128 void MidiMessageFilter::OnFilterAdded(IPC::Sender* sender) { 128 void MidiMessageFilter::OnFilterAdded(IPC::Channel* channel) {
129 DCHECK(io_task_runner_->BelongsToCurrentThread()); 129 DCHECK(io_task_runner_->BelongsToCurrentThread());
130 sender_ = sender; 130 sender_ = channel;
131 } 131 }
132 132
133 void MidiMessageFilter::OnFilterRemoved() { 133 void MidiMessageFilter::OnFilterRemoved() {
134 DCHECK(io_task_runner_->BelongsToCurrentThread()); 134 DCHECK(io_task_runner_->BelongsToCurrentThread());
135 // Once removed, a filter will not be used again. At this time all 135 // Once removed, a filter will not be used again. At this time all
136 // delegates must be notified so they release their reference. 136 // delegates must be notified so they release their reference.
137 OnChannelClosing(); 137 OnChannelClosing();
138 } 138 }
139 139
140 void MidiMessageFilter::OnChannelClosing() { 140 void MidiMessageFilter::OnChannelClosing() {
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 void MidiMessageFilter::HandleSetOutputPortState( 311 void MidiMessageFilter::HandleSetOutputPortState(
312 uint32_t port, 312 uint32_t port,
313 media::midi::MidiPortState state) { 313 media::midi::MidiPortState state) {
314 DCHECK(main_task_runner_->BelongsToCurrentThread()); 314 DCHECK(main_task_runner_->BelongsToCurrentThread());
315 outputs_[port].state = state; 315 outputs_[port].state = state;
316 for (auto* client : clients_) 316 for (auto* client : clients_)
317 client->didSetOutputPortState(port, ToBlinkState(state)); 317 client->didSetOutputPortState(port, ToBlinkState(state));
318 } 318 }
319 319
320 } // namespace content 320 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/midi_message_filter.h ('k') | content/renderer/media/video_capture_message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698