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

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

Issue 1646583002: [Reland] Per WebViewScheduler virtual time (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: WebViewSchedulerImpl to unregister the virtual_time_domain_ in the destructor Created 4 years, 11 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
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 0e1630cbbd914909a7405a5e4bb9a7c68848af58..5304f1339d089dd13c04f46acefcc32902042bb2 100644
--- a/third_party/WebKit/public/platform/WebViewScheduler.h
+++ b/third_party/WebKit/public/platform/WebViewScheduler.h
@@ -21,6 +21,25 @@ public:
// Creaters a new WebFrameScheduler, the caller is responsible for deleting it.
virtual WebPassOwnPtr<WebFrameScheduler> createFrameScheduler() = 0;
+
+ // Instructs this WebViewScheduler to use virtual time. When virtual time is enabled
+ // the system doesn't actually sleep for the delays between tasks before executing
+ // them. E.g: A-E are delayed tasks
+ //
+ // | A B C D E (normal)
+ // |-----------------------------> time
+ //
+ // |ABCDE (virtual time)
+ // |-----------------------------> time
+ virtual void useVirtualTime() = 0;
+
+ // Controls whether or not virtual time is allowed to advance. If virtual time
+ // is not allowed to advance then 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;
Sami 2016/02/01 11:15:07 Mention that useVirtualTime() must be called befor
alex clarke (OOO till 29th) 2016/02/01 14:16:54 But it can be used in any order.
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698