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

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

Issue 2565013002: Split browser-specific and generic code in components/task_scheduler_util/. (Closed)
Patch Set: self-review Created 4 years 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_content_browser_client.h" 5 #include "chrome/browser/chrome_content_browser_client.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 #include "components/pref_registry/pref_registry_syncable.h" 137 #include "components/pref_registry/pref_registry_syncable.h"
138 #include "components/prefs/pref_service.h" 138 #include "components/prefs/pref_service.h"
139 #include "components/prefs/scoped_user_pref_update.h" 139 #include "components/prefs/scoped_user_pref_update.h"
140 #include "components/rappor/public/rappor_utils.h" 140 #include "components/rappor/public/rappor_utils.h"
141 #include "components/rappor/rappor_recorder_impl.h" 141 #include "components/rappor/rappor_recorder_impl.h"
142 #include "components/rappor/rappor_service_impl.h" 142 #include "components/rappor/rappor_service_impl.h"
143 #include "components/security_interstitials/core/ssl_error_ui.h" 143 #include "components/security_interstitials/core/ssl_error_ui.h"
144 #include "components/signin/core/common/profile_management_switches.h" 144 #include "components/signin/core/common/profile_management_switches.h"
145 #include "components/spellcheck/spellcheck_build_features.h" 145 #include "components/spellcheck/spellcheck_build_features.h"
146 #include "components/startup_metric_utils/browser/startup_metric_host_impl.h" 146 #include "components/startup_metric_utils/browser/startup_metric_host_impl.h"
147 #include "components/task_scheduler_util/initialization/browser_util.h" 147 #include "components/task_scheduler_util/browser/initialization.h"
148 #include "components/task_scheduler_util/variations/browser_variations_util.h"
149 #include "components/translate/core/common/translate_switches.h" 148 #include "components/translate/core/common/translate_switches.h"
150 #include "components/url_formatter/url_fixer.h" 149 #include "components/url_formatter/url_fixer.h"
151 #include "components/variations/variations_associated_data.h" 150 #include "components/variations/variations_associated_data.h"
152 #include "components/version_info/version_info.h" 151 #include "components/version_info/version_info.h"
153 #include "content/public/browser/browser_child_process_host.h" 152 #include "content/public/browser/browser_child_process_host.h"
154 #include "content/public/browser/browser_main_parts.h" 153 #include "content/public/browser/browser_main_parts.h"
155 #include "content/public/browser/browser_ppapi_host.h" 154 #include "content/public/browser/browser_ppapi_host.h"
156 #include "content/public/browser/browser_thread.h" 155 #include "content/public/browser/browser_thread.h"
157 #include "content/public/browser/browser_url_handler.h" 156 #include "content/public/browser/browser_url_handler.h"
158 #include "content/public/browser/child_process_data.h" 157 #include "content/public/browser/child_process_data.h"
(...skipping 3170 matching lines...) Expand 10 before | Expand all | Expand 10 after
3329 } 3328 }
3330 #endif // BUILDFLAG(ENABLE_MEDIA_REMOTING) 3329 #endif // BUILDFLAG(ENABLE_MEDIA_REMOTING)
3331 3330
3332 void ChromeContentBrowserClient::GetTaskSchedulerInitializationParams( 3331 void ChromeContentBrowserClient::GetTaskSchedulerInitializationParams(
3333 std::vector<base::SchedulerWorkerPoolParams>* params_vector, 3332 std::vector<base::SchedulerWorkerPoolParams>* params_vector,
3334 base::TaskScheduler::WorkerPoolIndexForTraitsCallback* 3333 base::TaskScheduler::WorkerPoolIndexForTraitsCallback*
3335 index_to_traits_callback) { 3334 index_to_traits_callback) {
3336 DCHECK(params_vector); 3335 DCHECK(params_vector);
3337 DCHECK(index_to_traits_callback); 3336 DCHECK(index_to_traits_callback);
3338 // If this call fails, content will fall back to the default params. 3337 // If this call fails, content will fall back to the default params.
3339 *params_vector = 3338 std::map<std::string, std::string> variation_params;
3340 task_scheduler_util::variations:: 3339 if (variations::GetVariationParams("BrowserScheduler", &variation_params)) {
3341 GetBrowserSchedulerWorkerPoolParamsFromVariations(); 3340 *params_vector =
3342 *index_to_traits_callback = base::Bind(&task_scheduler_util::initialization:: 3341 task_scheduler_util::GetBrowserWorkerPoolParams(variation_params);
3343 BrowserWorkerPoolIndexForTraits); 3342 *index_to_traits_callback =
3343 base::Bind(&task_scheduler_util::BrowserWorkerPoolIndexForTraits);
3344 }
3344 } 3345 }
3345 3346
3346 void ChromeContentBrowserClient:: 3347 void ChromeContentBrowserClient::
3347 PerformExperimentalTaskSchedulerRedirections() { 3348 PerformExperimentalTaskSchedulerRedirections() {
3348 task_scheduler_util::variations:: 3349 std::map<std::string, std::string> variation_params;
3349 MaybePerformBrowserTaskSchedulerRedirection(); 3350 if (variations::GetVariationParams("BrowserScheduler", &variation_params)) {
3351 task_scheduler_util::MaybePerformBrowserTaskSchedulerRedirection(
3352 variation_params);
3353 }
3350 } 3354 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698