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

Unified Diff: public/platform/WebScheduler.h

Issue 1325073002: Introduce WebTaskRunner Patch 1/5 (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix comment Created 5 years, 3 months 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
« no previous file with comments | « public/BUILD.gn ('k') | public/platform/WebTaskRunner.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: public/platform/WebScheduler.h
diff --git a/public/platform/WebScheduler.h b/public/platform/WebScheduler.h
index b29ef632388710979433c70326a05b8eed5eb57e..6164d7638a07fd48f96220e8e0f313b14d1199ef 100644
--- a/public/platform/WebScheduler.h
+++ b/public/platform/WebScheduler.h
@@ -6,6 +6,7 @@
#define WebScheduler_h
#include "WebCommon.h"
+#include "public/platform/WebTaskRunner.h"
#include "public/platform/WebThread.h"
namespace blink {
@@ -60,12 +61,14 @@ public:
// tasks usually have the default priority, but may be deprioritised
// when the user is interacting with the device.
// Takes ownership of |WebThread::Task|. Can be called from any thread.
+ // TODO(alexclarke): Remove this in favour of loadingTaskRunner().
virtual void postLoadingTask(const WebTraceLocation&, WebThread::Task*) { }
// Schedule a timer task to be run on the the associated WebThread. Timer Tasks
// tasks usually have the default priority, but may be delayed
// when the user is interacting with the device.
// Takes ownership of |WebThread::Task|. Can be called from any thread.
+ // TODO(alexclarke): Remove this in favour of timerTaskRunner().
virtual void postTimerTask(const WebTraceLocation&, WebThread::Task*, long long delayMs) {}
// Schedule a timer task to be run on the the associated WebThread. Timer Tasks
@@ -75,6 +78,12 @@ public:
// Takes ownership of |WebThread::Task|. Can be called from any thread.
virtual void postTimerTaskAt(const WebTraceLocation&, WebThread::Task*, double monotonicTime) {}
+ // Returns a WebTaskRunner for loading tasks. Can be called from any thread.
+ virtual WebTaskRunner* loadingTaskRunner() { return nullptr; }
+
+ // Returns a WebTaskRunner for timer tasks. Can be called from any thread.
+ virtual WebTaskRunner* timerTaskRunner() { return nullptr; }
+
// Suspends the timer queue and increments the timer queue suspension count.
// May only be called from the main thread.
virtual void suspendTimerQueue() { }
« no previous file with comments | « public/BUILD.gn ('k') | public/platform/WebTaskRunner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698