Allow only one bookmark to be added for multiple fast starring
[chromium-blink-merge.git] / components / scheduler / child / worker_scheduler.cc
blob87ab8a1c294c522319f42d5e2cfc6023cf722971
1 // Copyright 2015 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/child/worker_scheduler.h"
7 #include "base/command_line.h"
8 #include "base/message_loop/message_loop.h"
9 #include "components/scheduler/child/null_worker_scheduler.h"
10 #include "components/scheduler/child/scheduler_task_runner_delegate.h"
11 #include "components/scheduler/child/worker_scheduler_impl.h"
12 #include "components/scheduler/common/scheduler_switches.h"
14 namespace scheduler {
16 WorkerScheduler::WorkerScheduler() {
19 WorkerScheduler::~WorkerScheduler() {
22 // static
23 scoped_ptr<WorkerScheduler> WorkerScheduler::Create(
24 scoped_refptr<SchedulerTaskRunnerDelegate> main_task_runner) {
25 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
26 if (command_line->HasSwitch(switches::kDisableBlinkScheduler)) {
27 return make_scoped_ptr(new NullWorkerScheduler());
28 } else {
29 return make_scoped_ptr(new WorkerSchedulerImpl(main_task_runner.Pass()));
33 } // namespace scheduler