OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "chrome/renderer/media/cast_session.h" | 5 #include "chrome/renderer/media/cast_session.h" |
6 | 6 |
7 #include "base/message_loop/message_loop_proxy.h" | 7 #include "base/message_loop/message_loop_proxy.h" |
8 #include "chrome/renderer/media/cast_session_delegate.h" | 8 #include "chrome/renderer/media/cast_session_delegate.h" |
9 #include "content/public/renderer/render_thread.h" | 9 #include "content/public/renderer/render_thread.h" |
10 | 10 |
11 CastSession::CastSession() | 11 CastSession::CastSession() |
12 : delegate_(new CastSessionDelegate()), | 12 : delegate_(new CastSessionDelegate()), |
13 io_message_loop_proxy_( | 13 io_message_loop_proxy_( |
14 content::RenderThread::Get()->GetIOMessageLoopProxy()) { | 14 content::RenderThread::Get()->GetIOMessageLoopProxy()) { |
15 } | 15 } |
16 | 16 |
17 CastSession::~CastSession() { | 17 CastSession::~CastSession() { |
18 // We should always be able to delete the object on the IO thread. | 18 // We should always be able to delete the object on the IO thread. |
19 CHECK(io_message_loop_proxy_->DeleteSoon(FROM_HERE, delegate_.release())); | 19 CHECK(io_message_loop_proxy_->DeleteSoon(FROM_HERE, delegate_.release())); |
20 } | 20 } |
| 21 |
| 22 void CastSession::SetSocketFactory(SocketFactory* socket_factory, |
| 23 const net::IPEndPoint& remote_address) { |
| 24 io_message_loop_proxy_->PostTask( |
| 25 FROM_HERE, |
| 26 base::Bind(&CastSessionDelegate::SetSocketFactory, |
| 27 base::Unretained(delegate_.get()), |
| 28 socket_factory, |
| 29 remote_address)); |
| 30 } |
| 31 |
| 32 CastSession::SocketFactory::~SocketFactory() { |
| 33 } |
OLD | NEW |