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

Side by Side Diff: chrome/service/service_process.cc

Issue 2729523006: Remove the |max_threads| argument from CreateAndSetSimpleTaskScheduler(). (Closed)
Patch Set: self-review Created 3 years, 9 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/service/service_process.h" 5 #include "chrome/service/service_process.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/base_switches.h" 10 #include "base/base_switches.h"
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 io_thread_.reset(new ServiceIOThread("ServiceProcess_IO")); 154 io_thread_.reset(new ServiceIOThread("ServiceProcess_IO"));
155 file_thread_.reset(new base::Thread("ServiceProcess_File")); 155 file_thread_.reset(new base::Thread("ServiceProcess_File"));
156 if (!io_thread_->StartWithOptions(options) || 156 if (!io_thread_->StartWithOptions(options) ||
157 !file_thread_->StartWithOptions(options)) { 157 !file_thread_->StartWithOptions(options)) {
158 NOTREACHED(); 158 NOTREACHED();
159 Teardown(); 159 Teardown();
160 return false; 160 return false;
161 } 161 }
162 162
163 // Initialize TaskScheduler and redirect SequencedWorkerPool tasks to it. 163 // Initialize TaskScheduler and redirect SequencedWorkerPool tasks to it.
164 constexpr int kMaxTaskSchedulerThreads = 3; 164 base::TaskScheduler::CreateAndSetSimpleTaskScheduler("Service");
robliao 2017/03/13 23:56:05 Maybe CloudPrintServiceProcess?
fdoray 2017/03/14 15:08:22 Done.
165 base::TaskScheduler::CreateAndSetSimpleTaskScheduler(
166 kMaxTaskSchedulerThreads);
167 base::SequencedWorkerPool::EnableWithRedirectionToTaskSchedulerForProcess(); 165 base::SequencedWorkerPool::EnableWithRedirectionToTaskSchedulerForProcess();
168 166
169 blocking_pool_ = new base::SequencedWorkerPool( 167 blocking_pool_ = new base::SequencedWorkerPool(
170 3, "ServiceBlocking", base::TaskPriority::USER_VISIBLE); 168 3, "ServiceBlocking", base::TaskPriority::USER_VISIBLE);
171 169
172 // Initialize Mojo early so things can use it. 170 // Initialize Mojo early so things can use it.
173 mojo::edk::Init(); 171 mojo::edk::Init();
174 mojo_ipc_support_.reset(new mojo::edk::ScopedIPCSupport( 172 mojo_ipc_support_.reset(new mojo::edk::ScopedIPCSupport(
175 io_thread_->task_runner(), 173 io_thread_->task_runner(),
176 mojo::edk::ScopedIPCSupport::ShutdownPolicy::FAST)); 174 mojo::edk::ScopedIPCSupport::ShutdownPolicy::FAST));
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 } else { 423 } else {
426 Shutdown(); 424 Shutdown();
427 } 425 }
428 } 426 }
429 } 427 }
430 428
431 ServiceProcess::~ServiceProcess() { 429 ServiceProcess::~ServiceProcess() {
432 Teardown(); 430 Teardown();
433 g_service_process = NULL; 431 g_service_process = NULL;
434 } 432 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698