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

Unified Diff: content/public/renderer/content_renderer_client.h

Issue 2491823005: Initialize TaskScheduler in renderers. (Closed)
Patch Set: do not enable in this CL 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 side-by-side diff with in-line comments
Download patch
Index: content/public/renderer/content_renderer_client.h
diff --git a/content/public/renderer/content_renderer_client.h b/content/public/renderer/content_renderer_client.h
index 5e62b3a451a3a8c8b184daa436fc14c56a5ee342..940d7c7812d31042999715bef490d63b0cf7d0d2 100644
--- a/content/public/renderer/content_renderer_client.h
+++ b/content/public/renderer/content_renderer_client.h
@@ -13,6 +13,7 @@
#include <vector>
#include "base/bind.h"
+#include "base/callback_forward.h"
#include "base/memory/ref_counted.h"
#include "base/strings/string16.h"
#include "build/build_config.h"
@@ -28,7 +29,9 @@ class SkBitmap;
namespace base {
class FilePath;
+class SchedulerWorkerPoolParams;
class SingleThreadTaskRunner;
+class TaskTraits;
}
namespace blink {
@@ -136,6 +139,19 @@ class CONTENT_EXPORT ContentRendererClient {
virtual bool ShouldSuppressErrorPage(RenderFrame* render_frame,
const GURL& url);
+ // Returns true if the renderer should initialize a TaskScheduler. If so,
+ // |worker_pool_params_vector| is filled with parameters describing the worker
+ // pools to create, |worker_pool_index_for_traits_callback| is set to a
+ // callback that returns the index in |worker_pools_params_vector| of the
+ // worker pool in which a task with given traits should run and
+ // |should_redirect_sequenced_worker_pool| indicates whether
+ // SequencedWorkerPools should be redirected to TaskScheduler.
+ virtual bool ShouldInitializeTaskScheduler(
+ std::vector<base::SchedulerWorkerPoolParams>* worker_pool_params_vector,
+ base::Callback<size_t(const base::TaskTraits& traits)>*
+ worker_pool_index_for_traits_callback,
+ bool* should_redirect_sequenced_worker_pool);
+
// Returns the information to display when a navigation error occurs.
// If |error_html| is not null then it may be set to a HTML page containing
// the details of the error and maybe links to more info.
« no previous file with comments | « no previous file | content/public/renderer/content_renderer_client.cc » ('j') | content/renderer/render_process_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698