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

Unified Diff: public/platform/WebScheduler.h

Issue 956333002: Refactor TimeBase to post tasks. Workers to use real Idle tasks. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 8 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/platform/Platform.h ('k') | no next file » | 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 463d1300af735ada6a105b97c63716c5c66145e6..0110aeed885230e13c7098363f46b4ae58709f56 100644
--- a/public/platform/WebScheduler.h
+++ b/public/platform/WebScheduler.h
@@ -64,10 +64,18 @@ public:
// Takes ownership of |WebThread::Task|. Can be called from any thread.
virtual void postTimerTask(const WebTraceLocation&, WebThread::Task*, long long delayMs) { }
+ // Schedule a shutdown task to be run on the the associated WebThread. Shutdown
+ // tasks can run at any time, including after preShutdown has been called.
+ // Takes ownership of |WebThread::Task|. Can be called from any thread.
+ virtual void postShutdownTask(const WebTraceLocation&, WebThread::Task*, long long delayMs) { }
+
+ // Prevents execution of all tasks posted vis this interface, except shutdown tasks.
+ virtual void preShutdown() { }
+
#ifdef INSIDE_BLINK
// Helpers for posting bound functions as tasks.
- typedef Function<void(double deadlineSeconds)> IdleTask;
- typedef Function<void()> Task;
+ typedef WTF::Function<void(double deadlineSeconds)> IdleTask;
+ typedef WTF::Function<void()> Task;
void postIdleTask(const WebTraceLocation&, PassOwnPtr<IdleTask>);
void postNonNestableIdleTask(const WebTraceLocation&, PassOwnPtr<IdleTask>);
« no previous file with comments | « public/platform/Platform.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698