OLD | NEW |
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/bind.h" |
(...skipping 1501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1512 url::Replacements<char> r; | 1512 url::Replacements<char> r; |
1513 r.SetPath(path.c_str(), url::Component(0, path.length())); | 1513 r.SetPath(path.c_str(), url::Component(0, path.length())); |
1514 | 1514 |
1515 if (result == internal::NUM_PLUGIN_ERROR) | 1515 if (result == internal::NUM_PLUGIN_ERROR) |
1516 result = invalid_url ? internal::SUCCESS_PARAMS_REWRITE : internal::SUCCESS; | 1516 result = invalid_url ? internal::SUCCESS_PARAMS_REWRITE : internal::SUCCESS; |
1517 | 1517 |
1518 RecordYouTubeRewriteUMA(result); | 1518 RecordYouTubeRewriteUMA(result); |
1519 return corrected_url.ReplaceComponents(r); | 1519 return corrected_url.ReplaceComponents(r); |
1520 } | 1520 } |
1521 | 1521 |
1522 void ChromeContentRendererClient::GetTaskSchedulerInitializationParams( | 1522 std::unique_ptr<base::TaskScheduler::InitParams> |
1523 std::vector<base::SchedulerWorkerPoolParams>* params_vector, | 1523 ChromeContentRendererClient::GetTaskSchedulerInitParams() { |
1524 base::TaskScheduler::WorkerPoolIndexForTraitsCallback* | 1524 return task_scheduler_util:: |
1525 index_to_traits_callback) { | 1525 GetRendererTaskSchedulerInitParamsFromCommandLine(); |
1526 DCHECK(params_vector); | |
1527 DCHECK(index_to_traits_callback); | |
1528 // If this call fails, content will fall back to the default params. | |
1529 *params_vector = task_scheduler_util::GetRendererWorkerPoolParams(); | |
1530 *index_to_traits_callback = | |
1531 base::Bind(&task_scheduler_util::RendererWorkerPoolIndexForTraits); | |
1532 } | 1526 } |
OLD | NEW |