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

Side by Side Diff: content/public/renderer/content_renderer_client.cc

Issue 2491823005: Initialize TaskScheduler in renderers. (Closed)
Patch Set: self-review Created 4 years, 1 month 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 "content/public/renderer/content_renderer_client.h" 5 #include "content/public/renderer/content_renderer_client.h"
6 6
7 #include "base/task_scheduler/initialization_util.h"
8 #include "base/time/time.h"
7 #include "cc/blimp/remote_compositor_bridge.h" 9 #include "cc/blimp/remote_compositor_bridge.h"
8 #include "content/public/renderer/media_stream_renderer_factory.h" 10 #include "content/public/renderer/media_stream_renderer_factory.h"
9 #include "media/base/renderer_factory.h" 11 #include "media/base/renderer_factory.h"
10 #include "ui/gfx/icc_profile.h" 12 #include "ui/gfx/icc_profile.h"
11 #include "url/gurl.h" 13 #include "url/gurl.h"
12 14
13 namespace content { 15 namespace content {
14 16
15 SkBitmap* ContentRendererClient::GetSadPluginBitmap() { 17 SkBitmap* ContentRendererClient::GetSadPluginBitmap() {
16 return nullptr; 18 return nullptr;
(...skipping 20 matching lines...) Expand all
37 bool ContentRendererClient::HasErrorPage(int http_status_code, 39 bool ContentRendererClient::HasErrorPage(int http_status_code,
38 std::string* error_domain) { 40 std::string* error_domain) {
39 return false; 41 return false;
40 } 42 }
41 43
42 bool ContentRendererClient::ShouldSuppressErrorPage(RenderFrame* render_frame, 44 bool ContentRendererClient::ShouldSuppressErrorPage(RenderFrame* render_frame,
43 const GURL& url) { 45 const GURL& url) {
44 return false; 46 return false;
45 } 47 }
46 48
49 void ContentRendererClient::GetTaskSchedulerInitializationArguments(
50 int* max_background_threads,
51 base::TimeDelta* background_reclaim_time,
52 int* max_foreground_threads,
53 base::TimeDelta* foreground_reclaim_time,
54 bool* redirect_sequenced_worker_pool) {
55 constexpr int kBackgroundMin = 3;
56 constexpr int kBackgroundMax = 8;
57 constexpr double kBackgroundCoresMultiplier = 0.1;
58 constexpr int kBackgroundOffset = 0;
59 *max_background_threads = base::MaxNumberOfThreadsInPool(
60 kBackgroundMin, kBackgroundMax, kBackgroundCoresMultiplier,
61 kBackgroundOffset);
62 *background_reclaim_time = base::TimeDelta::FromSeconds(30);
63
64 constexpr int kForegroundMin = 8;
65 constexpr int kForegroundMax = 32;
66 constexpr double kForegroundCoresMultiplier = 0.3;
67 constexpr int kForegroundOffset = 0;
68 *max_foreground_threads = base::MaxNumberOfThreadsInPool(
69 kForegroundMin, kForegroundMax, kForegroundCoresMultiplier,
70 kForegroundOffset);
71 *foreground_reclaim_time = base::TimeDelta::FromSeconds(30);
72
73 *redirect_sequenced_worker_pool = false;
74 }
75
47 void ContentRendererClient::DeferMediaLoad( 76 void ContentRendererClient::DeferMediaLoad(
48 RenderFrame* render_frame, 77 RenderFrame* render_frame,
49 bool has_played_media_before, 78 bool has_played_media_before,
50 const base::Closure& closure) { 79 const base::Closure& closure) {
51 closure.Run(); 80 closure.Run();
52 } 81 }
53 82
54 blink::WebMediaStreamCenter* 83 blink::WebMediaStreamCenter*
55 ContentRendererClient::OverrideCreateWebMediaStreamCenter( 84 ContentRendererClient::OverrideCreateWebMediaStreamCenter(
56 blink::WebMediaStreamCenterClient* client) { 85 blink::WebMediaStreamCenterClient* client) {
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 261
233 bool ContentRendererClient::ShouldEnforceWebRTCRoutingPreferences() { 262 bool ContentRendererClient::ShouldEnforceWebRTCRoutingPreferences() {
234 return true; 263 return true;
235 } 264 }
236 265
237 GURL ContentRendererClient::OverrideFlashEmbedWithHTML(const GURL& url) { 266 GURL ContentRendererClient::OverrideFlashEmbedWithHTML(const GURL& url) {
238 return GURL(); 267 return GURL();
239 } 268 }
240 269
241 } // namespace content 270 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698