| 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 "media/cast/cast_environment.h" | 5 #include "media/cast/cast_environment.h" |
| 6 | 6 |
| 7 #include <utility> |
| 8 |
| 7 #include "base/bind.h" | 9 #include "base/bind.h" |
| 8 #include "base/location.h" | 10 #include "base/location.h" |
| 9 #include "base/logging.h" | 11 #include "base/logging.h" |
| 10 | 12 |
| 11 using base::SingleThreadTaskRunner; | 13 using base::SingleThreadTaskRunner; |
| 12 | 14 |
| 13 namespace media { | 15 namespace media { |
| 14 namespace cast { | 16 namespace cast { |
| 15 | 17 |
| 16 CastEnvironment::CastEnvironment( | 18 CastEnvironment::CastEnvironment( |
| 17 scoped_ptr<base::TickClock> clock, | 19 scoped_ptr<base::TickClock> clock, |
| 18 scoped_refptr<SingleThreadTaskRunner> main_thread_proxy, | 20 scoped_refptr<SingleThreadTaskRunner> main_thread_proxy, |
| 19 scoped_refptr<SingleThreadTaskRunner> audio_thread_proxy, | 21 scoped_refptr<SingleThreadTaskRunner> audio_thread_proxy, |
| 20 scoped_refptr<SingleThreadTaskRunner> video_thread_proxy) | 22 scoped_refptr<SingleThreadTaskRunner> video_thread_proxy) |
| 21 : main_thread_proxy_(main_thread_proxy), | 23 : main_thread_proxy_(main_thread_proxy), |
| 22 audio_thread_proxy_(audio_thread_proxy), | 24 audio_thread_proxy_(audio_thread_proxy), |
| 23 video_thread_proxy_(video_thread_proxy), | 25 video_thread_proxy_(video_thread_proxy), |
| 24 clock_(clock.Pass()), | 26 clock_(std::move(clock)), |
| 25 logger_(this) {} | 27 logger_(this) {} |
| 26 | 28 |
| 27 CastEnvironment::~CastEnvironment() {} | 29 CastEnvironment::~CastEnvironment() {} |
| 28 | 30 |
| 29 bool CastEnvironment::PostTask(ThreadId identifier, | 31 bool CastEnvironment::PostTask(ThreadId identifier, |
| 30 const tracked_objects::Location& from_here, | 32 const tracked_objects::Location& from_here, |
| 31 const base::Closure& task) { | 33 const base::Closure& task) { |
| 32 return GetTaskRunner(identifier)->PostTask(from_here, task); | 34 return GetTaskRunner(identifier)->PostTask(from_here, task); |
| 33 } | 35 } |
| 34 | 36 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 return video_thread_proxy_.get() && | 69 return video_thread_proxy_.get() && |
| 68 video_thread_proxy_->RunsTasksOnCurrentThread(); | 70 video_thread_proxy_->RunsTasksOnCurrentThread(); |
| 69 default: | 71 default: |
| 70 NOTREACHED() << "Invalid thread identifier"; | 72 NOTREACHED() << "Invalid thread identifier"; |
| 71 return false; | 73 return false; |
| 72 } | 74 } |
| 73 } | 75 } |
| 74 | 76 |
| 75 } // namespace cast | 77 } // namespace cast |
| 76 } // namespace media | 78 } // namespace media |
| OLD | NEW |