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

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

Issue 2486603003: Redirect HistoryService thread to TaskScheduler via a field trial. (Closed)
Patch Set: self-review 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
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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 #include "chrome/common/net/net_resource_provider.h" 115 #include "chrome/common/net/net_resource_provider.h"
116 #include "chrome/common/pref_names.h" 116 #include "chrome/common/pref_names.h"
117 #include "chrome/common/profiling.h" 117 #include "chrome/common/profiling.h"
118 #include "chrome/common/stack_sampling_configuration.h" 118 #include "chrome/common/stack_sampling_configuration.h"
119 #include "chrome/grit/generated_resources.h" 119 #include "chrome/grit/generated_resources.h"
120 #include "chrome/installer/util/google_update_settings.h" 120 #include "chrome/installer/util/google_update_settings.h"
121 #include "components/component_updater/component_updater_service.h" 121 #include "components/component_updater/component_updater_service.h"
122 #include "components/device_event_log/device_event_log.h" 122 #include "components/device_event_log/device_event_log.h"
123 #include "components/flags_ui/pref_service_flags_storage.h" 123 #include "components/flags_ui/pref_service_flags_storage.h"
124 #include "components/google/core/browser/google_util.h" 124 #include "components/google/core/browser/google_util.h"
125 #include "components/history/core/browser/history_service.h"
125 #include "components/language_usage_metrics/language_usage_metrics.h" 126 #include "components/language_usage_metrics/language_usage_metrics.h"
126 #include "components/metrics/call_stack_profile_metrics_provider.h" 127 #include "components/metrics/call_stack_profile_metrics_provider.h"
127 #include "components/metrics/metrics_reporting_default_state.h" 128 #include "components/metrics/metrics_reporting_default_state.h"
128 #include "components/metrics/metrics_service.h" 129 #include "components/metrics/metrics_service.h"
129 #include "components/metrics/profiler/content/content_tracking_synchronizer_dele gate.h" 130 #include "components/metrics/profiler/content/content_tracking_synchronizer_dele gate.h"
130 #include "components/metrics/profiler/tracking_synchronizer.h" 131 #include "components/metrics/profiler/tracking_synchronizer.h"
131 #include "components/metrics_services_manager/metrics_services_manager.h" 132 #include "components/metrics_services_manager/metrics_services_manager.h"
132 #include "components/nacl/browser/nacl_browser.h" 133 #include "components/nacl/browser/nacl_browser.h"
133 #include "components/prefs/json_pref_store.h" 134 #include "components/prefs/json_pref_store.h"
134 #include "components/prefs/pref_registry_simple.h" 135 #include "components/prefs/pref_registry_simple.h"
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 << "The Browser Task Scheduler remains disabled with " 324 << "The Browser Task Scheduler remains disabled with "
324 << switches::kEnableBrowserTaskScheduler 325 << switches::kEnableBrowserTaskScheduler
325 << " because there is no available variation param for this build or " 326 << " because there is no available variation param for this build or "
326 " the task scheduler is disabled in chrome://flags."; 327 " the task scheduler is disabled in chrome://flags.";
327 return; 328 return;
328 } 329 }
329 330
330 if (!task_scheduler_util::InitializeDefaultTaskScheduler(variation_params)) 331 if (!task_scheduler_util::InitializeDefaultTaskScheduler(variation_params))
331 return; 332 return;
332 333
333 // TODO(gab): Remove this when http://crbug.com/622400 concludes. 334 // TODO(gab): Remove this when https://crbug.com/622400 concludes.
334 const auto sequenced_worker_pool_param = 335 const auto sequenced_worker_pool_param =
335 variation_params.find("RedirectSequencedWorkerPools"); 336 variation_params.find("RedirectSequencedWorkerPools");
336 if (sequenced_worker_pool_param != variation_params.end() && 337 if (sequenced_worker_pool_param != variation_params.end() &&
337 sequenced_worker_pool_param->second == "true") { 338 sequenced_worker_pool_param->second == "true") {
338 base::SequencedWorkerPool::RedirectToTaskSchedulerForProcess(); 339 base::SequencedWorkerPool::RedirectToTaskSchedulerForProcess();
339 } 340 }
341
342 // TODO(fdoray): Remove this when https://crbug.com/661143 concludes.
robliao 2016/11/08 22:21:50 Add this to ios_chrome_main_parts.mm. Side though
343 const auto history_service_param =
344 variation_params.find("RedirectHistoryService");
345 if (history_service_param != variation_params.end() &&
346 history_service_param->second == "true") {
347 history::HistoryService::RedirectToTaskSchedulerForProcess();
348 }
340 } 349 }
341 350
342 // Returns the new local state object, guaranteed non-NULL. 351 // Returns the new local state object, guaranteed non-NULL.
343 // |local_state_task_runner| must be a shutdown-blocking task runner. 352 // |local_state_task_runner| must be a shutdown-blocking task runner.
344 PrefService* InitializeLocalState( 353 PrefService* InitializeLocalState(
345 base::SequencedTaskRunner* local_state_task_runner, 354 base::SequencedTaskRunner* local_state_task_runner,
346 const base::CommandLine& parsed_command_line) { 355 const base::CommandLine& parsed_command_line) {
347 TRACE_EVENT0("startup", "ChromeBrowserMainParts::InitializeLocalState") 356 TRACE_EVENT0("startup", "ChromeBrowserMainParts::InitializeLocalState")
348 357
349 // Load local state. This includes the application locale so we know which 358 // Load local state. This includes the application locale so we know which
(...skipping 1765 matching lines...) Expand 10 before | Expand all | Expand 10 after
2115 chromeos::CrosSettings::Shutdown(); 2124 chromeos::CrosSettings::Shutdown();
2116 #endif // defined(OS_CHROMEOS) 2125 #endif // defined(OS_CHROMEOS)
2117 #endif // defined(OS_ANDROID) 2126 #endif // defined(OS_ANDROID)
2118 } 2127 }
2119 2128
2120 // Public members: 2129 // Public members:
2121 2130
2122 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { 2131 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) {
2123 chrome_extra_parts_.push_back(parts); 2132 chrome_extra_parts_.push_back(parts);
2124 } 2133 }
OLDNEW
« no previous file with comments | « no previous file | components/history/core/browser/history_service.h » ('j') | components/history/core/browser/history_service.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698