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 "chrome/common/cast_messages.h" | 7 #include "chrome/common/cast_messages.h" |
8 #include "chrome/renderer/media/cast_transport_sender_ipc.h" | 8 #include "chrome/renderer/media/cast_transport_sender_ipc.h" |
9 #include "ipc/ipc_message_macros.h" | 9 #include "ipc/ipc_message_macros.h" |
10 | 10 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 } | 45 } |
46 | 46 |
47 bool CastIPCDispatcher::OnMessageReceived(const IPC::Message& message) { | 47 bool CastIPCDispatcher::OnMessageReceived(const IPC::Message& message) { |
48 DCHECK(io_message_loop_->BelongsToCurrentThread()); | 48 DCHECK(io_message_loop_->BelongsToCurrentThread()); |
49 bool handled = true; | 49 bool handled = true; |
50 IPC_BEGIN_MESSAGE_MAP(CastIPCDispatcher, message) | 50 IPC_BEGIN_MESSAGE_MAP(CastIPCDispatcher, message) |
51 IPC_MESSAGE_HANDLER(CastMsg_NotifyStatusChange, OnNotifyStatusChange) | 51 IPC_MESSAGE_HANDLER(CastMsg_NotifyStatusChange, OnNotifyStatusChange) |
52 IPC_MESSAGE_HANDLER(CastMsg_RawEvents, OnRawEvents) | 52 IPC_MESSAGE_HANDLER(CastMsg_RawEvents, OnRawEvents) |
53 IPC_MESSAGE_HANDLER(CastMsg_Rtt, OnRtt) | 53 IPC_MESSAGE_HANDLER(CastMsg_Rtt, OnRtt) |
54 IPC_MESSAGE_HANDLER(CastMsg_RtcpCastMessage, OnRtcpCastMessage) | 54 IPC_MESSAGE_HANDLER(CastMsg_RtcpCastMessage, OnRtcpCastMessage) |
| 55 IPC_MESSAGE_HANDLER(CastMsg_ReceivedPacket, OnReceivedPacket) |
55 IPC_MESSAGE_UNHANDLED(handled = false); | 56 IPC_MESSAGE_UNHANDLED(handled = false); |
56 IPC_END_MESSAGE_MAP(); | 57 IPC_END_MESSAGE_MAP(); |
57 return handled; | 58 return handled; |
58 } | 59 } |
59 | 60 |
60 void CastIPCDispatcher::OnFilterAdded(IPC::Sender* sender) { | 61 void CastIPCDispatcher::OnFilterAdded(IPC::Sender* sender) { |
61 DCHECK(io_message_loop_->BelongsToCurrentThread()); | 62 DCHECK(io_message_loop_->BelongsToCurrentThread()); |
62 DCHECK(!global_instance_); | 63 DCHECK(!global_instance_); |
63 global_instance_ = this; | 64 global_instance_ = this; |
64 sender_ = sender; | 65 sender_ = sender; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 int32 channel_id, | 116 int32 channel_id, |
116 uint32 ssrc, | 117 uint32 ssrc, |
117 const media::cast::RtcpCastMessage& cast_message) { | 118 const media::cast::RtcpCastMessage& cast_message) { |
118 CastTransportSenderIPC* sender = id_map_.Lookup(channel_id); | 119 CastTransportSenderIPC* sender = id_map_.Lookup(channel_id); |
119 if (sender) { | 120 if (sender) { |
120 sender->OnRtcpCastMessage(ssrc, cast_message); | 121 sender->OnRtcpCastMessage(ssrc, cast_message); |
121 } else { | 122 } else { |
122 DVLOG(1) << "CastIPCDispatcher::OnRtt on non-existing channel."; | 123 DVLOG(1) << "CastIPCDispatcher::OnRtt on non-existing channel."; |
123 } | 124 } |
124 } | 125 } |
| 126 |
| 127 void CastIPCDispatcher::OnReceivedPacket( |
| 128 int32 channel_id, |
| 129 const media::cast::Packet& packet) { |
| 130 CastTransportSenderIPC* sender = id_map_.Lookup(channel_id); |
| 131 if (sender) { |
| 132 sender->OnReceivedPacket(packet); |
| 133 } else { |
| 134 DVLOG(1) << "CastIPCDispatcher::OnReceievdPacket on non-existing channel."; |
| 135 } |
| 136 } |
OLD | NEW |