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

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

Issue 2799433002: Use TaskScheduler::InitParams to initialize TaskScheduler in browser process. (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « chrome/browser/chrome_content_browser_client.h ('k') | content/browser/browser_main_loop.cc » ('j') | 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_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 3563 matching lines...) Expand 10 before | Expand all | Expand 10 after
3574 #else 3574 #else
3575 // Chrome's media remoting implementation depends on the Media Router 3575 // Chrome's media remoting implementation depends on the Media Router
3576 // infrastructure to identify remote sinks and provide the user interface for 3576 // infrastructure to identify remote sinks and provide the user interface for
3577 // sink selection. In the case where the Media Router is not present, simply 3577 // sink selection. In the case where the Media Router is not present, simply
3578 // drop the interface request. This will prevent code paths for media remoting 3578 // drop the interface request. This will prevent code paths for media remoting
3579 // in the renderer process from activating. 3579 // in the renderer process from activating.
3580 #endif 3580 #endif
3581 } 3581 }
3582 #endif // BUILDFLAG(ENABLE_MEDIA_REMOTING) 3582 #endif // BUILDFLAG(ENABLE_MEDIA_REMOTING)
3583 3583
3584 void ChromeContentBrowserClient::GetTaskSchedulerInitializationParams( 3584 std::unique_ptr<base::TaskScheduler::InitParams>
3585 std::vector<base::SchedulerWorkerPoolParams>* params_vector, 3585 ChromeContentBrowserClient::GetTaskSchedulerInitParams() {
3586 base::TaskScheduler::WorkerPoolIndexForTraitsCallback* 3586 return task_scheduler_util::GetBrowserTaskSchedulerInitParamsFromVariations();
3587 index_to_traits_callback) {
3588 DCHECK(params_vector);
3589 DCHECK(index_to_traits_callback);
3590 // If this call fails, content will fall back to the default params.
3591 *params_vector =
3592 task_scheduler_util::GetBrowserWorkerPoolParamsFromVariations();
3593 *index_to_traits_callback =
3594 base::Bind(&task_scheduler_util::BrowserWorkerPoolIndexForTraits);
3595 } 3587 }
3596 3588
3597 void ChromeContentBrowserClient:: 3589 void ChromeContentBrowserClient::
3598 PerformExperimentalTaskSchedulerRedirections() { 3590 PerformExperimentalTaskSchedulerRedirections() {
3599 task_scheduler_util::MaybePerformBrowserTaskSchedulerRedirection(); 3591 task_scheduler_util::MaybePerformBrowserTaskSchedulerRedirection();
3600 } 3592 }
3601 3593
3602 bool ChromeContentBrowserClient::ShouldRedirectDOMStorageTaskRunner() { 3594 bool ChromeContentBrowserClient::ShouldRedirectDOMStorageTaskRunner() {
3603 return variations::GetVariationParamValue( 3595 return variations::GetVariationParamValue(
3604 "BrowserScheduler", "RedirectDOMStorageTaskRunner") == "true"; 3596 "BrowserScheduler", "RedirectDOMStorageTaskRunner") == "true";
3605 } 3597 }
3606 3598
3607 bool ChromeContentBrowserClient:: 3599 bool ChromeContentBrowserClient::
3608 RedirectNonUINonIOBrowserThreadsToTaskScheduler() { 3600 RedirectNonUINonIOBrowserThreadsToTaskScheduler() {
3609 return variations::GetVariationParamValue( 3601 return variations::GetVariationParamValue(
3610 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; 3602 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true";
3611 } 3603 }
3612 3604
3613 // static 3605 // static
3614 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting( 3606 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting(
3615 const storage::QuotaSettings* settings) { 3607 const storage::QuotaSettings* settings) {
3616 g_default_quota_settings = settings; 3608 g_default_quota_settings = settings;
3617 } 3609 }
OLDNEW
« no previous file with comments | « chrome/browser/chrome_content_browser_client.h ('k') | content/browser/browser_main_loop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698