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

Side by Side Diff: base/task_scheduler/task_scheduler.cc

Issue 1701343003: TaskScheduler [13] TaskSchedulerImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@s_6_threadpool
Patch Set: fix ios build error Created 4 years, 7 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
« no previous file with comments | « base/task_scheduler/sequence_sort_key.h ('k') | base/task_scheduler/task_scheduler_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "base/task_scheduler/task_scheduler.h" 5 #include "base/task_scheduler/task_scheduler.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/task_scheduler/task_scheduler_impl.h"
8 9
9 namespace base { 10 namespace base {
10 11
11 namespace { 12 namespace {
12 13
13 // |g_task_scheduler| is intentionally leaked on shutdown. 14 // |g_task_scheduler| is intentionally leaked on shutdown.
14 TaskScheduler* g_task_scheduler = nullptr; 15 TaskScheduler* g_task_scheduler = nullptr;
15 16
16 } // namespace 17 } // namespace
17 18
18 // static 19 // static
19 void TaskScheduler::SetInstance(std::unique_ptr<TaskScheduler> task_scheduler) { 20 void TaskScheduler::SetInstance(std::unique_ptr<TaskScheduler> task_scheduler) {
20 delete g_task_scheduler; 21 delete g_task_scheduler;
21 g_task_scheduler = task_scheduler.release(); 22 g_task_scheduler = task_scheduler.release();
22 } 23 }
23 24
24 // static 25 // static
25 void TaskScheduler::InitializeDefaultTaskScheduler() { 26 void TaskScheduler::InitializeDefaultTaskScheduler() {
26 NOTIMPLEMENTED(); 27 SetInstance(internal::TaskSchedulerImpl::Create());
27 } 28 }
28 29
29 // static 30 // static
30 TaskScheduler* TaskScheduler::GetInstance() { 31 TaskScheduler* TaskScheduler::GetInstance() {
31 return g_task_scheduler; 32 return g_task_scheduler;
32 } 33 }
33 34
34 } // namespace base 35 } // namespace base
OLDNEW
« no previous file with comments | « base/task_scheduler/sequence_sort_key.h ('k') | base/task_scheduler/task_scheduler_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698