| 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 #ifndef MEDIA_CAST_TEST_UTILITY_STANDALONE_CAST_ENVIRONMENT_H_ | 5 #ifndef MEDIA_CAST_TEST_UTILITY_STANDALONE_CAST_ENVIRONMENT_H_ |
| 6 #define MEDIA_CAST_TEST_UTILITY_STANDALONE_CAST_ENVIRONMENT_H_ | 6 #define MEDIA_CAST_TEST_UTILITY_STANDALONE_CAST_ENVIRONMENT_H_ |
| 7 | 7 |
| 8 #include "base/threading/thread.h" | 8 #include "base/threading/thread.h" |
| 9 #include "base/threading/thread_checker.h" | 9 #include "base/threading/thread_checker.h" |
| 10 #include "media/cast/cast_environment.h" | 10 #include "media/cast/cast_environment.h" |
| 11 | 11 |
| 12 namespace media { | 12 namespace media { |
| 13 namespace cast { | 13 namespace cast { |
| 14 | 14 |
| 15 // A complete CastEnvironment where all task runners are spurned from | 15 // A complete CastEnvironment where all task runners are spurned from |
| 16 // internally-owned threads. Uses base::DefaultTickClock as a clock. | 16 // internally-owned threads. Uses base::DefaultTickClock as a clock. |
| 17 class StandaloneCastEnvironment : public CastEnvironment, | 17 class StandaloneCastEnvironment : public CastEnvironment, |
| 18 public base::ThreadChecker { | 18 public base::ThreadChecker { |
| 19 public: | 19 public: |
| 20 explicit StandaloneCastEnvironment(); | 20 StandaloneCastEnvironment(); |
| 21 | 21 |
| 22 // Stops all threads backing the task runners, blocking the caller until | 22 // Stops all threads backing the task runners, blocking the caller until |
| 23 // complete. | 23 // complete. |
| 24 void Shutdown(); | 24 void Shutdown(); |
| 25 | 25 |
| 26 private: | 26 private: |
| 27 virtual ~StandaloneCastEnvironment(); | 27 virtual ~StandaloneCastEnvironment(); |
| 28 | 28 |
| 29 base::Thread main_thread_; | 29 base::Thread main_thread_; |
| 30 base::Thread audio_thread_; | 30 base::Thread audio_thread_; |
| 31 base::Thread video_thread_; | 31 base::Thread video_thread_; |
| 32 | 32 |
| 33 DISALLOW_COPY_AND_ASSIGN(StandaloneCastEnvironment); | 33 DISALLOW_COPY_AND_ASSIGN(StandaloneCastEnvironment); |
| 34 }; | 34 }; |
| 35 | 35 |
| 36 } // namespace cast | 36 } // namespace cast |
| 37 } // namespace media | 37 } // namespace media |
| 38 | 38 |
| 39 #endif // MEDIA_CAST_TEST_UTILITY_STANDALONE_CAST_ENVIRONMENT_H_ | 39 #endif // MEDIA_CAST_TEST_UTILITY_STANDALONE_CAST_ENVIRONMENT_H_ |
| OLD | NEW |