[Media Router] Add integration tests and e2e tests for media router and presentation...
[chromium-blink-merge.git] / components / scheduler / renderer / renderer_scheduler.cc
blob914b8025cc1966ddacc953c2e817d47d24201bb2
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 #include "components/scheduler/renderer/renderer_scheduler.h"
7 #include "base/command_line.h"
8 #include "base/message_loop/message_loop.h"
9 #include "base/trace_event/trace_event.h"
10 #include "base/trace_event/trace_event_impl.h"
11 #include "components/scheduler/child/scheduler_message_loop_delegate.h"
12 #include "components/scheduler/common/scheduler_switches.h"
13 #include "components/scheduler/renderer/null_renderer_scheduler.h"
14 #include "components/scheduler/renderer/renderer_scheduler_impl.h"
16 namespace scheduler {
18 RendererScheduler::RendererScheduler() {
21 RendererScheduler::~RendererScheduler() {
24 // static
25 scoped_ptr<RendererScheduler> RendererScheduler::Create() {
26 // Ensure worker.scheduler, worker.scheduler.debug and
27 // renderer.scheduler.debug appear as an option in about://tracing
28 base::trace_event::TraceLog::GetCategoryGroupEnabled(
29 TRACE_DISABLED_BY_DEFAULT("worker.scheduler"));
30 base::trace_event::TraceLog::GetCategoryGroupEnabled(
31 TRACE_DISABLED_BY_DEFAULT("worker.scheduler.debug"));
32 base::trace_event::TraceLog::GetCategoryGroupEnabled(
33 TRACE_DISABLED_BY_DEFAULT("renderer.scheduler.debug"));
35 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
36 if (command_line->HasSwitch(switches::kDisableBlinkScheduler)) {
37 return make_scoped_ptr(new NullRendererScheduler());
38 } else {
39 base::MessageLoop* message_loop = base::MessageLoop::current();
40 return make_scoped_ptr(new RendererSchedulerImpl(
41 SchedulerMessageLoopDelegate::Create(message_loop)));
45 } // namespace scheduler