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/message_loop/message_loop.h"
8 #include "base/trace_event/trace_event.h"
9 #include "base/trace_event/trace_event_impl.h"
10 #include "components/scheduler/child/scheduler_task_runner_delegate_impl.h"
11 #include "components/scheduler/renderer/renderer_scheduler_impl.h"
15 RendererScheduler::RendererScheduler() {
18 RendererScheduler::~RendererScheduler() {
22 scoped_ptr
<RendererScheduler
> RendererScheduler::Create() {
23 // Ensure worker.scheduler, worker.scheduler.debug and
24 // renderer.scheduler.debug appear as an option in about://tracing
25 base::trace_event::TraceLog::GetCategoryGroupEnabled(
26 TRACE_DISABLED_BY_DEFAULT("worker.scheduler"));
27 base::trace_event::TraceLog::GetCategoryGroupEnabled(
28 TRACE_DISABLED_BY_DEFAULT("worker.scheduler.debug"));
29 base::trace_event::TraceLog::GetCategoryGroupEnabled(
30 TRACE_DISABLED_BY_DEFAULT("renderer.scheduler.debug"));
32 base::MessageLoop
* message_loop
= base::MessageLoop::current();
33 return make_scoped_ptr(new RendererSchedulerImpl(
34 SchedulerTaskRunnerDelegateImpl::Create(message_loop
)));
37 } // namespace scheduler