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

Side by Side Diff: chrome/browser/chrome_browser_main.cc

Issue 2506693002: Enable Initialization of the Task Scheduler by Default in the Browser Process (Closed)
Patch Set: Created 4 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/browser/chrome_browser_main.h" 5 #include "chrome/browser/chrome_browser_main.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 void AddFirstRunNewTabs(StartupBrowserCreator* browser_creator, 308 void AddFirstRunNewTabs(StartupBrowserCreator* browser_creator,
309 const std::vector<GURL>& new_tabs) { 309 const std::vector<GURL>& new_tabs) {
310 for (std::vector<GURL>::const_iterator it = new_tabs.begin(); 310 for (std::vector<GURL>::const_iterator it = new_tabs.begin();
311 it != new_tabs.end(); ++it) { 311 it != new_tabs.end(); ++it) {
312 if (it->is_valid()) 312 if (it->is_valid())
313 browser_creator->AddFirstRunTab(*it); 313 browser_creator->AddFirstRunTab(*it);
314 } 314 }
315 } 315 }
316 #endif // !defined(OS_ANDROID) && !defined(OS_CHROMEOS) 316 #endif // !defined(OS_ANDROID) && !defined(OS_CHROMEOS)
317 317
318 void MaybeInitializeTaskScheduler() { 318 void MaybeInitializeTaskScheduler() {
fdoray 2016/11/15 18:40:17 No Maybe
robliao 2016/11/16 19:04:17 Done.
319 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
320 switches::kDisableBrowserTaskScheduler)) {
321 return;
322 }
fdoray 2016/11/15 18:40:16 To migrate WorkerPool call sites, TaskScheduler mu
gab 2016/11/15 20:40:33 Agreed, can't ever have a disabled scheduler. As
robliao 2016/11/16 19:04:17 Done.
robliao 2016/11/16 19:04:17 Done.
323
319 static constexpr char kFieldTrialName[] = "BrowserScheduler"; 324 static constexpr char kFieldTrialName[] = "BrowserScheduler";
320 std::map<std::string, std::string> variation_params; 325 std::map<std::string, std::string> variation_params;
321 if (!variations::GetVariationParams(kFieldTrialName, &variation_params)) { 326 if (!variations::GetVariationParams(kFieldTrialName, &variation_params)) {
322 DCHECK(!base::CommandLine::ForCurrentProcess()->HasSwitch( 327 variation_params["Background"] = "3;8;0.1;0;30000";
323 switches::kEnableBrowserTaskScheduler)) 328 variation_params["BackgroundFileIO"] = "3;8;0.1;0;30000";
324 << "The Browser Task Scheduler remains disabled with " 329 variation_params["Foreground"] = "8;32;0.3;0;30000";
325 << switches::kEnableBrowserTaskScheduler 330 variation_params["ForegroundFileIO"] = "8;32;0.3;0;30000";
fdoray 2016/11/15 18:40:16 To avoid duplication between iOS and other platfor
gab 2016/11/15 20:40:33 Need different defaults for OS_ANDROID too to matc
robliao 2016/11/16 19:04:17 That's a natural result of the content DEPS restri
robliao 2016/11/16 19:04:17 If some params are missing and invalid, we probabl
326 << " because there is no available variation param for this build or "
327 " the task scheduler is disabled in chrome://flags.";
328 return;
329 } 331 }
330 332
331 if (!task_scheduler_util::InitializeDefaultTaskScheduler(variation_params)) 333 if (!task_scheduler_util::InitializeDefaultTaskScheduler(variation_params))
332 return; 334 return;
333 335
334 // TODO(gab): Remove this when http://crbug.com/622400 concludes. 336 // TODO(gab): Remove this when http://crbug.com/622400 concludes.
335 const auto sequenced_worker_pool_param = 337 const auto sequenced_worker_pool_param =
336 variation_params.find("RedirectSequencedWorkerPools"); 338 variation_params.find("RedirectSequencedWorkerPools");
337 if (sequenced_worker_pool_param != variation_params.end() && 339 if (sequenced_worker_pool_param != variation_params.end() &&
338 sequenced_worker_pool_param->second == "true") { 340 sequenced_worker_pool_param->second == "true") {
(...skipping 1781 matching lines...) Expand 10 before | Expand all | Expand 10 after
2120 chromeos::CrosSettings::Shutdown(); 2122 chromeos::CrosSettings::Shutdown();
2121 #endif // defined(OS_CHROMEOS) 2123 #endif // defined(OS_CHROMEOS)
2122 #endif // defined(OS_ANDROID) 2124 #endif // defined(OS_ANDROID)
2123 } 2125 }
2124 2126
2125 // Public members: 2127 // Public members:
2126 2128
2127 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { 2129 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) {
2128 chrome_extra_parts_.push_back(parts); 2130 chrome_extra_parts_.push_back(parts);
2129 } 2131 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698