Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1165)

Side by Side Diff: media/cast/test/utility/standalone_cast_environment.cc

Issue 229503002: Cast: Make castv2 mirroring performance test run again (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix a cast sender bug too Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/time/default_tick_clock.h" 7 #include "base/time/default_tick_clock.h"
8 8
9 namespace media { 9 namespace media {
10 namespace cast { 10 namespace cast {
11 11
12 StandaloneCastEnvironment::StandaloneCastEnvironment() 12 StandaloneCastEnvironment::StandaloneCastEnvironment()
13 : CastEnvironment( 13 : CastEnvironment(
14 make_scoped_ptr<base::TickClock>(new base::DefaultTickClock()), 14 make_scoped_ptr<base::TickClock>(new base::DefaultTickClock()),
15 NULL, 15 NULL,
16 NULL, 16 NULL,
17 NULL), 17 NULL),
18 main_thread_("StandaloneCastEnvironment Main"), 18 main_thread_("StandaloneCastEnvironment Main"),
19 audio_thread_("StandaloneCastEnvironment Audio"), 19 audio_thread_("StandaloneCastEnvironment Audio"),
20 video_thread_("StandaloneCastEnvironment Video") { 20 video_thread_("StandaloneCastEnvironment Video") {
21 #define CREATE_TASK_RUNNER(name, options) \ 21 #define CREATE_TASK_RUNNER(name, options) \
22 name##_thread_.StartWithOptions(options); \ 22 name##_thread_.StartWithOptions(options); \
23 CastEnvironment::name##_thread_proxy_ = name##_thread_.message_loop_proxy() 23 CastEnvironment::name##_thread_proxy_ = name##_thread_.message_loop_proxy()
24 24
25 CREATE_TASK_RUNNER(main, 25 CREATE_TASK_RUNNER(main,
26 base::Thread::Options(base::MessageLoop::TYPE_IO, 0)); 26 base::Thread::Options(base::MessageLoop::TYPE_IO, 0));
27 CREATE_TASK_RUNNER(audio, base::Thread::Options()); 27 CREATE_TASK_RUNNER(audio, base::Thread::Options());
28 CREATE_TASK_RUNNER(video, base::Thread::Options()); 28 CREATE_TASK_RUNNER(video, base::Thread::Options());
29 }
30
31 StandaloneCastEnvironment::StandaloneCastEnvironment(
32 scoped_ptr<base::TickClock> clock)
33 : CastEnvironment(
34 clock.Pass(),
35 NULL,
36 NULL,
37 NULL),
38 main_thread_("StandaloneCastEnvironment Main"),
39 audio_thread_("StandaloneCastEnvironment Audio"),
40 video_thread_("StandaloneCastEnvironment Video") {
41 CREATE_TASK_RUNNER(main,
42 base::Thread::Options(base::MessageLoop::TYPE_IO, 0));
43 CREATE_TASK_RUNNER(audio, base::Thread::Options());
44 CREATE_TASK_RUNNER(video, base::Thread::Options());
29 45
30 #undef CREATE_TASK_RUNNER 46 #undef CREATE_TASK_RUNNER
31 } 47 }
32 48
33 StandaloneCastEnvironment::~StandaloneCastEnvironment() { 49 StandaloneCastEnvironment::~StandaloneCastEnvironment() {
34 DCHECK(CalledOnValidThread()); 50 DCHECK(CalledOnValidThread());
35 } 51 }
36 52
37 void StandaloneCastEnvironment::Shutdown() { 53 void StandaloneCastEnvironment::Shutdown() {
38 DCHECK(CalledOnValidThread()); 54 DCHECK(CalledOnValidThread());
39 main_thread_.Stop(); 55 main_thread_.Stop();
40 audio_thread_.Stop(); 56 audio_thread_.Stop();
41 video_thread_.Stop(); 57 video_thread_.Stop();
42 } 58 }
43 59
44 } // namespace cast 60 } // namespace cast
45 } // namespace media 61 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698