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

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

Issue 2845913004: Remove TaskScheduler::CreateAndSetDefaultTaskScheduler(). (Closed)
Patch Set: fix-build-error Created 3 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/task_scheduler.h ('k') | base/test/scoped_async_task_scheduler.cc » ('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 <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 kSuggestedReclaimTime}, 64 kSuggestedReclaimTime},
65 {StandbyThreadPolicy::LAZY, kForegroundBlockingMaxThreads, 65 {StandbyThreadPolicy::LAZY, kForegroundBlockingMaxThreads,
66 kSuggestedReclaimTime}}); 66 kSuggestedReclaimTime}});
67 } 67 }
68 #endif // !defined(OS_NACL) 68 #endif // !defined(OS_NACL)
69 69
70 void TaskScheduler::Create(StringPiece name) { 70 void TaskScheduler::Create(StringPiece name) {
71 SetInstance(MakeUnique<internal::TaskSchedulerImpl>(name)); 71 SetInstance(MakeUnique<internal::TaskSchedulerImpl>(name));
72 } 72 }
73 73
74 void TaskScheduler::CreateAndSetDefaultTaskScheduler(
75 StringPiece name,
76 const InitParams& init_params) {
77 Create(name);
78 GetInstance()->Start(init_params);
79 }
80
81 // static 74 // static
82 void TaskScheduler::SetInstance(std::unique_ptr<TaskScheduler> task_scheduler) { 75 void TaskScheduler::SetInstance(std::unique_ptr<TaskScheduler> task_scheduler) {
83 delete g_task_scheduler; 76 delete g_task_scheduler;
84 g_task_scheduler = task_scheduler.release(); 77 g_task_scheduler = task_scheduler.release();
85 } 78 }
86 79
87 // static 80 // static
88 TaskScheduler* TaskScheduler::GetInstance() { 81 TaskScheduler* TaskScheduler::GetInstance() {
89 return g_task_scheduler; 82 return g_task_scheduler;
90 } 83 }
91 84
92 } // namespace base 85 } // namespace base
OLDNEW
« no previous file with comments | « base/task_scheduler/task_scheduler.h ('k') | base/test/scoped_async_task_scheduler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698