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

Side by Side Diff: content/child/child_process.cc

Issue 2729523006: Remove the |max_threads| argument from CreateAndSetSimpleTaskScheduler(). (Closed)
Patch Set: fix build error 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 "content/child/child_process.h" 5 #include "content/child/child_process.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 g_lazy_tls.Pointer()->Set(this); 48 g_lazy_tls.Pointer()->Set(this);
49 49
50 base::StatisticsRecorder::Initialize(); 50 base::StatisticsRecorder::Initialize();
51 51
52 // Initialize TaskScheduler if not already done. A TaskScheduler may already 52 // Initialize TaskScheduler if not already done. A TaskScheduler may already
53 // exist when ChildProcess is instantiated in the browser process or in a 53 // exist when ChildProcess is instantiated in the browser process or in a
54 // test process. 54 // test process.
55 if (!base::TaskScheduler::GetInstance()) { 55 if (!base::TaskScheduler::GetInstance()) {
56 if (worker_pool_params.empty()) { 56 if (worker_pool_params.empty()) {
57 DCHECK(!worker_pool_index_for_traits_callback); 57 DCHECK(!worker_pool_index_for_traits_callback);
58 constexpr int kMaxThreads = 2; 58 base::TaskScheduler::CreateAndSetSimpleTaskScheduler("ContentChild");
59 base::TaskScheduler::CreateAndSetSimpleTaskScheduler(kMaxThreads);
60 } else { 59 } else {
61 DCHECK(worker_pool_index_for_traits_callback); 60 DCHECK(worker_pool_index_for_traits_callback);
62 base::TaskScheduler::CreateAndSetDefaultTaskScheduler( 61 base::TaskScheduler::CreateAndSetDefaultTaskScheduler(
63 worker_pool_params, std::move(worker_pool_index_for_traits_callback)); 62 worker_pool_params, std::move(worker_pool_index_for_traits_callback));
64 } 63 }
65 64
66 DCHECK(base::TaskScheduler::GetInstance()); 65 DCHECK(base::TaskScheduler::GetInstance());
67 initialized_task_scheduler_ = true; 66 initialized_task_scheduler_ = true;
68 } 67 }
69 68
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 memset(&sa, 0, sizeof(sa)); 180 memset(&sa, 0, sizeof(sa));
182 sa.sa_handler = SigUSR1Handler; 181 sa.sa_handler = SigUSR1Handler;
183 sigaction(SIGUSR1, &sa, NULL); 182 sigaction(SIGUSR1, &sa, NULL);
184 183
185 pause(); 184 pause();
186 #endif // defined(OS_ANDROID) 185 #endif // defined(OS_ANDROID)
187 #endif // defined(OS_POSIX) 186 #endif // defined(OS_POSIX)
188 } 187 }
189 188
190 } // namespace content 189 } // namespace content
OLDNEW
« no previous file with comments | « components/cronet/ios/cronet_environment.mm ('k') | remoting/client/chromoting_client_runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698