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 #include "content/renderer/scheduler/renderer_scheduler.h" | 5 #include "content/renderer/scheduler/renderer_scheduler.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/message_loop/message_loop_proxy.h" | 8 #include "base/message_loop/message_loop_proxy.h" |
9 #include "content/public/common/content_switches.h" | 9 #include "content/public/common/content_switches.h" |
10 #include "content/renderer/scheduler/null_renderer_scheduler.h" | 10 #include "content/renderer/scheduler/null_renderer_scheduler.h" |
11 #include "content/renderer/scheduler/renderer_scheduler_impl.h" | 11 #include "content/renderer/scheduler/renderer_scheduler_impl.h" |
12 | 12 |
13 namespace content { | 13 namespace content { |
14 | 14 |
15 RendererScheduler::RendererScheduler() { | 15 RendererScheduler::RendererScheduler() { |
16 } | 16 } |
17 | 17 |
18 RendererScheduler::~RendererScheduler() { | 18 RendererScheduler::~RendererScheduler() { |
19 } | 19 } |
20 | 20 |
21 // static | 21 // static |
22 scoped_ptr<RendererScheduler> RendererScheduler::Create() { | 22 scoped_ptr<RendererScheduler> RendererScheduler::Create() { |
23 // FIXME: Some chromeos browser tests timeout with the scheduler enabled. | 23 // FIXME: Some chromeos browser tests timeout with the scheduler enabled. |
24 // See crbug.com/444574 | 24 // See crbug.com/444574 |
25 #ifdef OS_CHROMEOS | 25 #ifdef OS_CHROMEOS |
26 return make_scoped_ptr(new NullRendererScheduler()); | 26 return make_scoped_ptr(new NullRendererScheduler()); |
27 #endif | 27 #endif |
28 | 28 |
29 CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 29 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
30 if (command_line->HasSwitch(switches::kDisableBlinkScheduler)) { | 30 if (command_line->HasSwitch(switches::kDisableBlinkScheduler)) { |
31 return make_scoped_ptr(new NullRendererScheduler()); | 31 return make_scoped_ptr(new NullRendererScheduler()); |
32 } else { | 32 } else { |
33 return make_scoped_ptr( | 33 return make_scoped_ptr( |
34 new RendererSchedulerImpl(base::MessageLoopProxy::current())); | 34 new RendererSchedulerImpl(base::MessageLoopProxy::current())); |
35 } | 35 } |
36 } | 36 } |
37 | 37 |
38 } // namespace content | 38 } // namespace content |
OLD | NEW |