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

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: 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/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/command_line.h" 10 #include "base/command_line.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 #include "components/dom_distiller/core/url_constants.h" 72 #include "components/dom_distiller/core/url_constants.h"
73 #include "components/error_page/common/localized_error.h" 73 #include "components/error_page/common/localized_error.h"
74 #include "components/network_hints/renderer/prescient_networking_dispatcher.h" 74 #include "components/network_hints/renderer/prescient_networking_dispatcher.h"
75 #include "components/password_manager/content/renderer/credential_manager_client .h" 75 #include "components/password_manager/content/renderer/credential_manager_client .h"
76 #include "components/pdf/renderer/pepper_pdf_host.h" 76 #include "components/pdf/renderer/pepper_pdf_host.h"
77 #include "components/signin/core/common/profile_management_switches.h" 77 #include "components/signin/core/common/profile_management_switches.h"
78 #include "components/spellcheck/spellcheck_build_features.h" 78 #include "components/spellcheck/spellcheck_build_features.h"
79 #include "components/startup_metric_utils/common/startup_metric.mojom.h" 79 #include "components/startup_metric_utils/common/startup_metric.mojom.h"
80 #include "components/subresource_filter/content/renderer/ruleset_dealer.h" 80 #include "components/subresource_filter/content/renderer/ruleset_dealer.h"
81 #include "components/subresource_filter/content/renderer/subresource_filter_agen t.h" 81 #include "components/subresource_filter/content/renderer/subresource_filter_agen t.h"
82 #include "components/task_scheduler_util/renderer/initialization.h"
82 #include "components/version_info/version_info.h" 83 #include "components/version_info/version_info.h"
83 #include "components/visitedlink/renderer/visitedlink_slave.h" 84 #include "components/visitedlink/renderer/visitedlink_slave.h"
84 #include "components/web_cache/renderer/web_cache_impl.h" 85 #include "components/web_cache/renderer/web_cache_impl.h"
85 #include "content/public/common/content_constants.h" 86 #include "content/public/common/content_constants.h"
86 #include "content/public/common/content_switches.h" 87 #include "content/public/common/content_switches.h"
87 #include "content/public/common/url_constants.h" 88 #include "content/public/common/url_constants.h"
88 #include "content/public/renderer/plugin_instance_throttler.h" 89 #include "content/public/renderer/plugin_instance_throttler.h"
89 #include "content/public/renderer/render_frame.h" 90 #include "content/public/renderer/render_frame.h"
90 #include "content/public/renderer/render_thread.h" 91 #include "content/public/renderer/render_thread.h"
91 #include "content/public/renderer/render_view.h" 92 #include "content/public/renderer/render_view.h"
(...skipping 1375 matching lines...) Expand 10 before | Expand all | Expand 10 after
1467 1468
1468 url::Replacements<char> r; 1469 url::Replacements<char> r;
1469 r.SetPath(path.c_str(), url::Component(0, path.length())); 1470 r.SetPath(path.c_str(), url::Component(0, path.length()));
1470 1471
1471 if (result == internal::NUM_PLUGIN_ERROR) 1472 if (result == internal::NUM_PLUGIN_ERROR)
1472 result = invalid_url ? internal::SUCCESS_PARAMS_REWRITE : internal::SUCCESS; 1473 result = invalid_url ? internal::SUCCESS_PARAMS_REWRITE : internal::SUCCESS;
1473 1474
1474 RecordYouTubeRewriteUMA(result); 1475 RecordYouTubeRewriteUMA(result);
1475 return corrected_url.ReplaceComponents(r); 1476 return corrected_url.ReplaceComponents(r);
1476 } 1477 }
1478
1479 void ChromeContentRendererClient::GetTaskSchedulerInitializationParams(
1480 std::vector<base::SchedulerWorkerPoolParams>* params_vector,
1481 base::TaskScheduler::WorkerPoolIndexForTraitsCallback*
1482 index_to_traits_callback) {
1483 DCHECK(params_vector);
1484 DCHECK(index_to_traits_callback);
1485 // If this call fails, content will fall back to the default params.
1486 *params_vector = task_scheduler_util::GetRendererWorkerPoolParams();
1487 *index_to_traits_callback =
1488 base::Bind(&task_scheduler_util::RendererWorkerPoolIndexForTraits);
1489 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698