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

Side by Side 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, 7 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 unified diff | Download patch
« no previous file with comments | « public/platform/Platform.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef WebScheduler_h 5 #ifndef WebScheduler_h
6 #define WebScheduler_h 6 #define WebScheduler_h
7 7
8 #include "WebCommon.h" 8 #include "WebCommon.h"
9 #include "public/platform/WebThread.h" 9 #include "public/platform/WebThread.h"
10 10
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 // when the user is interacting with the device. 57 // when the user is interacting with the device.
58 // Takes ownership of |WebThread::Task|. Can be called from any thread. 58 // Takes ownership of |WebThread::Task|. Can be called from any thread.
59 virtual void postLoadingTask(const WebTraceLocation&, WebThread::Task*) { } 59 virtual void postLoadingTask(const WebTraceLocation&, WebThread::Task*) { }
60 60
61 // Schedule a timer task to be run on the the associated WebThread. Timer Ta sks 61 // Schedule a timer task to be run on the the associated WebThread. Timer Ta sks
62 // tasks usually have the default priority, but may be delayed 62 // tasks usually have the default priority, but may be delayed
63 // when the user is interacting with the device. 63 // when the user is interacting with the device.
64 // Takes ownership of |WebThread::Task|. Can be called from any thread. 64 // Takes ownership of |WebThread::Task|. Can be called from any thread.
65 virtual void postTimerTask(const WebTraceLocation&, WebThread::Task*, long l ong delayMs) { } 65 virtual void postTimerTask(const WebTraceLocation&, WebThread::Task*, long l ong delayMs) { }
66 66
67 // Schedule a shutdown task to be run on the the associated WebThread. Shutd own
68 // tasks can run at any time, including after preShutdown has been called.
69 // Takes ownership of |WebThread::Task|. Can be called from any thread.
70 virtual void postShutdownTask(const WebTraceLocation&, WebThread::Task*, lon g long delayMs) { }
71
72 // Prevents execution of all tasks posted vis this interface, except shutdow n tasks.
73 virtual void preShutdown() { }
74
67 #ifdef INSIDE_BLINK 75 #ifdef INSIDE_BLINK
68 // Helpers for posting bound functions as tasks. 76 // Helpers for posting bound functions as tasks.
69 typedef Function<void(double deadlineSeconds)> IdleTask; 77 typedef WTF::Function<void(double deadlineSeconds)> IdleTask;
70 typedef Function<void()> Task; 78 typedef WTF::Function<void()> Task;
71 79
72 void postIdleTask(const WebTraceLocation&, PassOwnPtr<IdleTask>); 80 void postIdleTask(const WebTraceLocation&, PassOwnPtr<IdleTask>);
73 void postNonNestableIdleTask(const WebTraceLocation&, PassOwnPtr<IdleTask>); 81 void postNonNestableIdleTask(const WebTraceLocation&, PassOwnPtr<IdleTask>);
74 void postIdleTaskAfterWakeup(const WebTraceLocation&, PassOwnPtr<IdleTask>); 82 void postIdleTaskAfterWakeup(const WebTraceLocation&, PassOwnPtr<IdleTask>);
75 void postLoadingTask(const WebTraceLocation&, PassOwnPtr<Task>); 83 void postLoadingTask(const WebTraceLocation&, PassOwnPtr<Task>);
76 #endif 84 #endif
77 }; 85 };
78 86
79 } // namespace blink 87 } // namespace blink
80 88
81 #endif // WebScheduler_h 89 #endif // WebScheduler_h
OLDNEW
« 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