| 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 "chrome/common/cast_messages.h" | 8 #include "chrome/common/cast_messages.h" |
| 8 #include "chrome/renderer/media/cast_transport_sender_ipc.h" | 9 #include "chrome/renderer/media/cast_transport_sender_ipc.h" |
| 9 #include "ipc/ipc_message_macros.h" | 10 #include "ipc/ipc_message_macros.h" |
| 10 | 11 |
| 11 CastIPCDispatcher* CastIPCDispatcher::global_instance_ = NULL; | 12 CastIPCDispatcher* CastIPCDispatcher::global_instance_ = NULL; |
| 12 | 13 |
| 13 CastIPCDispatcher::CastIPCDispatcher( | 14 CastIPCDispatcher::CastIPCDispatcher( |
| 14 const scoped_refptr<base::MessageLoopProxy>& io_message_loop) | 15 const scoped_refptr<base::SingleThreadTaskRunner>& io_message_loop) |
| 15 : sender_(NULL), | 16 : sender_(NULL), |
| 16 io_message_loop_(io_message_loop) { | 17 io_message_loop_(io_message_loop) { |
| 17 DCHECK(io_message_loop_.get()); | 18 DCHECK(io_message_loop_.get()); |
| 18 DCHECK(!global_instance_); | 19 DCHECK(!global_instance_); |
| 19 } | 20 } |
| 20 | 21 |
| 21 CastIPCDispatcher::~CastIPCDispatcher() { | 22 CastIPCDispatcher::~CastIPCDispatcher() { |
| 22 DCHECK(io_message_loop_->BelongsToCurrentThread()); | 23 DCHECK(io_message_loop_->BelongsToCurrentThread()); |
| 23 DCHECK(!global_instance_); | 24 DCHECK(!global_instance_); |
| 24 } | 25 } |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 void CastIPCDispatcher::OnReceivedPacket( | 128 void CastIPCDispatcher::OnReceivedPacket( |
| 128 int32 channel_id, | 129 int32 channel_id, |
| 129 const media::cast::Packet& packet) { | 130 const media::cast::Packet& packet) { |
| 130 CastTransportSenderIPC* sender = id_map_.Lookup(channel_id); | 131 CastTransportSenderIPC* sender = id_map_.Lookup(channel_id); |
| 131 if (sender) { | 132 if (sender) { |
| 132 sender->OnReceivedPacket(packet); | 133 sender->OnReceivedPacket(packet); |
| 133 } else { | 134 } else { |
| 134 DVLOG(1) << "CastIPCDispatcher::OnReceievdPacket on non-existing channel."; | 135 DVLOG(1) << "CastIPCDispatcher::OnReceievdPacket on non-existing channel."; |
| 135 } | 136 } |
| 136 } | 137 } |
| OLD | NEW |