Index: content/public/renderer/content_renderer_client.cc |
diff --git a/content/public/renderer/content_renderer_client.cc b/content/public/renderer/content_renderer_client.cc |
index 642521f5819662f50c28f83e12418c2ca6632a26..1113de0ab1f2879a09d5bdf8973fe0ae31bccc55 100644 |
--- a/content/public/renderer/content_renderer_client.cc |
+++ b/content/public/renderer/content_renderer_client.cc |
@@ -4,6 +4,8 @@ |
#include "content/public/renderer/content_renderer_client.h" |
+#include "base/task_scheduler/initialization_util.h" |
+#include "base/time/time.h" |
#include "cc/blimp/remote_compositor_bridge.h" |
#include "content/public/renderer/media_stream_renderer_factory.h" |
#include "media/base/renderer_factory.h" |
@@ -44,6 +46,33 @@ bool ContentRendererClient::ShouldSuppressErrorPage(RenderFrame* render_frame, |
return false; |
} |
+void ContentRendererClient::GetTaskSchedulerInitializationArguments( |
+ int* max_background_threads, |
+ base::TimeDelta* background_reclaim_time, |
+ int* max_foreground_threads, |
+ base::TimeDelta* foreground_reclaim_time, |
+ bool* redirect_sequenced_worker_pool) { |
+ constexpr int kBackgroundMin = 3; |
+ constexpr int kBackgroundMax = 8; |
+ constexpr double kBackgroundCoresMultiplier = 0.1; |
+ constexpr int kBackgroundOffset = 0; |
+ *max_background_threads = base::MaxNumberOfThreadsInPool( |
+ kBackgroundMin, kBackgroundMax, kBackgroundCoresMultiplier, |
+ kBackgroundOffset); |
+ *background_reclaim_time = base::TimeDelta::FromSeconds(30); |
+ |
+ constexpr int kForegroundMin = 8; |
+ constexpr int kForegroundMax = 32; |
+ constexpr double kForegroundCoresMultiplier = 0.3; |
+ constexpr int kForegroundOffset = 0; |
+ *max_foreground_threads = base::MaxNumberOfThreadsInPool( |
+ kForegroundMin, kForegroundMax, kForegroundCoresMultiplier, |
+ kForegroundOffset); |
+ *foreground_reclaim_time = base::TimeDelta::FromSeconds(30); |
+ |
+ *redirect_sequenced_worker_pool = false; |
+} |
+ |
void ContentRendererClient::DeferMediaLoad( |
RenderFrame* render_frame, |
bool has_played_media_before, |