OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/renderer/media/cast_ipc_dispatcher.h" | 5 #include "chrome/renderer/media/cast_ipc_dispatcher.h" |
6 | 6 |
7 #include "base/single_thread_task_runner.h" | 7 #include "base/single_thread_task_runner.h" |
8 #include "chrome/common/cast_messages.h" | 8 #include "chrome/common/cast_messages.h" |
9 #include "chrome/renderer/media/cast_transport_sender_ipc.h" | 9 #include "chrome/renderer/media/cast_transport_sender_ipc.h" |
10 #include "ipc/ipc_message_macros.h" | 10 #include "ipc/ipc_message_macros.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 | 47 |
48 bool CastIPCDispatcher::OnMessageReceived(const IPC::Message& message) { | 48 bool CastIPCDispatcher::OnMessageReceived(const IPC::Message& message) { |
49 DCHECK(io_task_runner_->BelongsToCurrentThread()); | 49 DCHECK(io_task_runner_->BelongsToCurrentThread()); |
50 bool handled = true; | 50 bool handled = true; |
51 IPC_BEGIN_MESSAGE_MAP(CastIPCDispatcher, message) | 51 IPC_BEGIN_MESSAGE_MAP(CastIPCDispatcher, message) |
52 IPC_MESSAGE_HANDLER(CastMsg_NotifyStatusChange, OnNotifyStatusChange) | 52 IPC_MESSAGE_HANDLER(CastMsg_NotifyStatusChange, OnNotifyStatusChange) |
53 IPC_MESSAGE_HANDLER(CastMsg_RawEvents, OnRawEvents) | 53 IPC_MESSAGE_HANDLER(CastMsg_RawEvents, OnRawEvents) |
54 IPC_MESSAGE_HANDLER(CastMsg_Rtt, OnRtt) | 54 IPC_MESSAGE_HANDLER(CastMsg_Rtt, OnRtt) |
55 IPC_MESSAGE_HANDLER(CastMsg_RtcpCastMessage, OnRtcpCastMessage) | 55 IPC_MESSAGE_HANDLER(CastMsg_RtcpCastMessage, OnRtcpCastMessage) |
56 IPC_MESSAGE_HANDLER(CastMsg_ReceivedPacket, OnReceivedPacket) | 56 IPC_MESSAGE_HANDLER(CastMsg_ReceivedPacket, OnReceivedPacket) |
57 IPC_MESSAGE_UNHANDLED(handled = false); | 57 IPC_MESSAGE_UNHANDLED(handled = false) |
58 IPC_END_MESSAGE_MAP(); | 58 IPC_END_MESSAGE_MAP() |
59 return handled; | 59 return handled; |
60 } | 60 } |
61 | 61 |
62 void CastIPCDispatcher::OnFilterAdded(IPC::Sender* sender) { | 62 void CastIPCDispatcher::OnFilterAdded(IPC::Sender* sender) { |
63 DCHECK(io_task_runner_->BelongsToCurrentThread()); | 63 DCHECK(io_task_runner_->BelongsToCurrentThread()); |
64 DCHECK(!global_instance_); | 64 DCHECK(!global_instance_); |
65 global_instance_ = this; | 65 global_instance_ = this; |
66 sender_ = sender; | 66 sender_ = sender; |
67 } | 67 } |
68 | 68 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 | 127 |
128 void CastIPCDispatcher::OnReceivedPacket(int32_t channel_id, | 128 void CastIPCDispatcher::OnReceivedPacket(int32_t channel_id, |
129 const media::cast::Packet& packet) { | 129 const media::cast::Packet& packet) { |
130 CastTransportSenderIPC* sender = id_map_.Lookup(channel_id); | 130 CastTransportSenderIPC* sender = id_map_.Lookup(channel_id); |
131 if (sender) { | 131 if (sender) { |
132 sender->OnReceivedPacket(packet); | 132 sender->OnReceivedPacket(packet); |
133 } else { | 133 } else { |
134 DVLOG(1) << "CastIPCDispatcher::OnReceievdPacket on non-existing channel."; | 134 DVLOG(1) << "CastIPCDispatcher::OnReceievdPacket on non-existing channel."; |
135 } | 135 } |
136 } | 136 } |
OLD | NEW |