Remove INJECT_EVENTS permissions from test APKs.
[chromium-blink-merge.git] / media / cast / test / utility / standalone_cast_environment.h
blob206de212f27736e753a70f45c03593b4213ce90e
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
3 // found in the LICENSE file.
5 #ifndef MEDIA_CAST_TEST_UTILITY_STANDALONE_CAST_ENVIRONMENT_H_
6 #define MEDIA_CAST_TEST_UTILITY_STANDALONE_CAST_ENVIRONMENT_H_
8 #include "base/threading/thread.h"
9 #include "base/threading/thread_checker.h"
10 #include "media/cast/cast_environment.h"
12 namespace media {
13 namespace cast {
15 // A complete CastEnvironment where all task runners are spurned from
16 // internally-owned threads. Uses base::DefaultTickClock as a clock.
18 // A user of StandaloneCastEnvironment *must* call Shutdown() on the same thread
19 // that constructed the instance before the ref-count reaches zero.
20 // http://crbug.com/396480
21 class StandaloneCastEnvironment : public CastEnvironment,
22 public base::ThreadChecker {
23 public:
24 StandaloneCastEnvironment();
26 // Stops all threads backing the task runners, blocking the caller until
27 // complete.
28 void Shutdown();
30 protected:
31 ~StandaloneCastEnvironment() override;
33 base::Thread main_thread_;
34 base::Thread audio_thread_;
35 base::Thread video_thread_;
37 DISALLOW_COPY_AND_ASSIGN(StandaloneCastEnvironment);
40 } // namespace cast
41 } // namespace media
43 #endif // MEDIA_CAST_TEST_UTILITY_STANDALONE_CAST_ENVIRONMENT_H_