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

Side by Side Diff: chrome/renderer/chrome_content_renderer_client.cc

Issue 2568793003: Control TaskScheduler initialization params in renderers via field trial. (Closed)
Patch Set: fix ios build error Created 3 years, 11 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 "chrome/renderer/chrome_content_renderer_client.h" 5 #include "chrome/renderer/chrome_content_renderer_client.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h"
10 #include "base/command_line.h" 11 #include "base/command_line.h"
11 #include "base/debug/crash_logging.h" 12 #include "base/debug/crash_logging.h"
12 #include "base/logging.h" 13 #include "base/logging.h"
13 #include "base/macros.h" 14 #include "base/macros.h"
14 #include "base/memory/ptr_util.h" 15 #include "base/memory/ptr_util.h"
15 #include "base/metrics/histogram_macros.h" 16 #include "base/metrics/histogram_macros.h"
16 #include "base/metrics/user_metrics_action.h" 17 #include "base/metrics/user_metrics_action.h"
17 #include "base/strings/string_number_conversions.h" 18 #include "base/strings/string_number_conversions.h"
18 #include "base/strings/string_util.h" 19 #include "base/strings/string_util.h"
19 #include "base/strings/utf_string_conversions.h" 20 #include "base/strings/utf_string_conversions.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 #include "components/dom_distiller/core/url_constants.h" 74 #include "components/dom_distiller/core/url_constants.h"
74 #include "components/error_page/common/localized_error.h" 75 #include "components/error_page/common/localized_error.h"
75 #include "components/network_hints/renderer/prescient_networking_dispatcher.h" 76 #include "components/network_hints/renderer/prescient_networking_dispatcher.h"
76 #include "components/password_manager/content/renderer/credential_manager_client .h" 77 #include "components/password_manager/content/renderer/credential_manager_client .h"
77 #include "components/pdf/renderer/pepper_pdf_host.h" 78 #include "components/pdf/renderer/pepper_pdf_host.h"
78 #include "components/signin/core/common/profile_management_switches.h" 79 #include "components/signin/core/common/profile_management_switches.h"
79 #include "components/spellcheck/spellcheck_build_features.h" 80 #include "components/spellcheck/spellcheck_build_features.h"
80 #include "components/startup_metric_utils/common/startup_metric.mojom.h" 81 #include "components/startup_metric_utils/common/startup_metric.mojom.h"
81 #include "components/subresource_filter/content/renderer/ruleset_dealer.h" 82 #include "components/subresource_filter/content/renderer/ruleset_dealer.h"
82 #include "components/subresource_filter/content/renderer/subresource_filter_agen t.h" 83 #include "components/subresource_filter/content/renderer/subresource_filter_agen t.h"
84 #include "components/task_scheduler_util/renderer/initialization.h"
83 #include "components/version_info/version_info.h" 85 #include "components/version_info/version_info.h"
84 #include "components/visitedlink/renderer/visitedlink_slave.h" 86 #include "components/visitedlink/renderer/visitedlink_slave.h"
85 #include "components/web_cache/renderer/web_cache_impl.h" 87 #include "components/web_cache/renderer/web_cache_impl.h"
86 #include "content/public/common/content_constants.h" 88 #include "content/public/common/content_constants.h"
87 #include "content/public/common/content_switches.h" 89 #include "content/public/common/content_switches.h"
88 #include "content/public/common/url_constants.h" 90 #include "content/public/common/url_constants.h"
89 #include "content/public/renderer/plugin_instance_throttler.h" 91 #include "content/public/renderer/plugin_instance_throttler.h"
90 #include "content/public/renderer/render_frame.h" 92 #include "content/public/renderer/render_frame.h"
91 #include "content/public/renderer/render_thread.h" 93 #include "content/public/renderer/render_thread.h"
92 #include "content/public/renderer/render_view.h" 94 #include "content/public/renderer/render_view.h"
(...skipping 1374 matching lines...) Expand 10 before | Expand all | Expand 10 after
1467 1469
1468 url::Replacements<char> r; 1470 url::Replacements<char> r;
1469 r.SetPath(path.c_str(), url::Component(0, path.length())); 1471 r.SetPath(path.c_str(), url::Component(0, path.length()));
1470 1472
1471 if (result == internal::NUM_PLUGIN_ERROR) 1473 if (result == internal::NUM_PLUGIN_ERROR)
1472 result = invalid_url ? internal::SUCCESS_PARAMS_REWRITE : internal::SUCCESS; 1474 result = invalid_url ? internal::SUCCESS_PARAMS_REWRITE : internal::SUCCESS;
1473 1475
1474 RecordYouTubeRewriteUMA(result); 1476 RecordYouTubeRewriteUMA(result);
1475 return corrected_url.ReplaceComponents(r); 1477 return corrected_url.ReplaceComponents(r);
1476 } 1478 }
1479
1480 void ChromeContentRendererClient::GetTaskSchedulerInitializationParams(
1481 std::vector<base::SchedulerWorkerPoolParams>* params_vector,
1482 base::TaskScheduler::WorkerPoolIndexForTraitsCallback*
1483 index_to_traits_callback) {
1484 DCHECK(params_vector);
1485 DCHECK(index_to_traits_callback);
1486 // If this call fails, content will fall back to the default params.
1487 *params_vector = task_scheduler_util::GetRendererWorkerPoolParams();
1488 *index_to_traits_callback =
1489 base::Bind(&task_scheduler_util::RendererWorkerPoolIndexForTraits);
1490 }
OLDNEW
« no previous file with comments | « chrome/renderer/chrome_content_renderer_client.h ('k') | components/task_scheduler_util/common/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698