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 "media/cast/test/utility/standalone_cast_environment.h" | 5 #include "media/cast/test/utility/standalone_cast_environment.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/threading/thread_restrictions.h" |
9 #include "base/time/default_tick_clock.h" | 10 #include "base/time/default_tick_clock.h" |
10 | 11 |
11 namespace media { | 12 namespace media { |
12 namespace cast { | 13 namespace cast { |
13 | 14 |
14 StandaloneCastEnvironment::StandaloneCastEnvironment() | 15 StandaloneCastEnvironment::StandaloneCastEnvironment() |
15 : CastEnvironment( | 16 : CastEnvironment( |
16 base::WrapUnique<base::TickClock>(new base::DefaultTickClock()), | 17 base::WrapUnique<base::TickClock>(new base::DefaultTickClock()), |
17 NULL, | 18 NULL, |
18 NULL, | 19 NULL, |
(...skipping 14 matching lines...) Expand all Loading... |
33 | 34 |
34 StandaloneCastEnvironment::~StandaloneCastEnvironment() { | 35 StandaloneCastEnvironment::~StandaloneCastEnvironment() { |
35 CHECK(CalledOnValidThread()); | 36 CHECK(CalledOnValidThread()); |
36 CHECK(!main_thread_.IsRunning()); | 37 CHECK(!main_thread_.IsRunning()); |
37 CHECK(!audio_thread_.IsRunning()); | 38 CHECK(!audio_thread_.IsRunning()); |
38 CHECK(!video_thread_.IsRunning()); | 39 CHECK(!video_thread_.IsRunning()); |
39 } | 40 } |
40 | 41 |
41 void StandaloneCastEnvironment::Shutdown() { | 42 void StandaloneCastEnvironment::Shutdown() { |
42 CHECK(CalledOnValidThread()); | 43 CHECK(CalledOnValidThread()); |
| 44 |
| 45 base::ThreadRestrictions::ScopedAllowIO |
| 46 because_i_brought_you_into_this_world_and_i_am_gonna_take_you_out; |
43 main_thread_.Stop(); | 47 main_thread_.Stop(); |
44 audio_thread_.Stop(); | 48 audio_thread_.Stop(); |
45 video_thread_.Stop(); | 49 video_thread_.Stop(); |
46 } | 50 } |
47 | 51 |
48 } // namespace cast | 52 } // namespace cast |
49 } // namespace media | 53 } // namespace media |
OLD | NEW |