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

Side by Side Diff: chrome/renderer/media/cast_ipc_dispatcher.cc

Issue 765643006: Cast: Make receiver use cast_transport (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix end2end test Created 6 years 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 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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698