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

Unified Diff: third_party/WebKit/public/platform/WebViewScheduler.h

Issue 2109843003: Adds enableVirtualTime and setVirtualTimePolicy To Emulation domain. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove frame iteration Created 4 years, 5 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 | « third_party/WebKit/public/platform/WebFrameScheduler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/public/platform/WebViewScheduler.h
diff --git a/third_party/WebKit/public/platform/WebViewScheduler.h b/third_party/WebKit/public/platform/WebViewScheduler.h
index 3635b784a04c751614fee6653e7850d56ea7553a..37eb20dfc945b1dc57b5dfa7a8d4db98410db2fd 100644
--- a/third_party/WebKit/public/platform/WebViewScheduler.h
+++ b/third_party/WebKit/public/platform/WebViewScheduler.h
@@ -37,13 +37,28 @@ public:
// |-----------------------------> time
virtual void enableVirtualTime() = 0;
- // Controls whether or not virtual time is allowed to advance. If virtual time
- // is not allowed to advance then delayed tasks posted to the WebTaskRunners owned
- // by any child WebFrameSchedulers will be paused. If virtual time is allowed to
- // advance then tasks will be run in time order (as usual) but virtual time will
- // fast forward so that the system doesn't actually sleep for the delays between
- // tasks before executing them.
- virtual void setAllowVirtualTimeToAdvance(bool) = 0;
+ // Returns true if virtual time is currently allowed to advance.
+ virtual bool virtualTimeAllowedToAdvance() const = 0;
+
+ enum class VirtualTimePolicy {
+ // In this policy virtual time is allowed to advance. If the blink scheduler runs out of
+ // immediate work, the virtual timebase will be incremented so that the next sceduled
+ // timer may fire. NOTE Tasks will be run in time order (as usual).
+ ADVANCE,
+
+ // In this policy virtual time is not allowed to advance. Delayed tasks posted to
+ // WebTaskRunners owned by any child WebFrameSchedulers will be paused, unless their
+ // scheduled run time is less than or equal to the current virtual time. Note non-delayed
+ // tasks will run as normal.
+ PAUSE,
+
+ // In this policy virtual time is allowed to advance unless there are pending network
+ // fetches associated any child WebFrameScheduler.
+ PAUSE_IF_NETWORK_FETCHES_PENDING
+ };
+
+ // Sets the virtual time policy, which is applied imemdiatly to all child WebFrameSchedulers.
+ virtual void setVirtualTimePolicy(VirtualTimePolicy) = 0;
};
} // namespace blink
« no previous file with comments | « third_party/WebKit/public/platform/WebFrameScheduler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698