Commit 409b9c00 authored by Alex Clarke's avatar Alex Clarke Committed by Commit Bot

Better documentation for WebScopedVirtualTimePauser

Updates the documentation as requested.

Bug: 873317
Change-Id: Id1deb86475f93896935e7962350af7033b0246e9
TBR: pfeldman@chromium.org
Reviewed-on: https://chromium-review.googlesource.com/1177397
Commit-Queue: Alex Clarke <alexclarke@chromium.org>
Reviewed-by: default avatarEric Seckler <eseckler@chromium.org>
Cr-Commit-Position: refs/heads/master@{#583992}
parent 704397d3
...@@ -14,8 +14,13 @@ namespace scheduler { ...@@ -14,8 +14,13 @@ namespace scheduler {
class MainThreadSchedulerImpl; class MainThreadSchedulerImpl;
} // namespace scheduler } // namespace scheduler
// A move only RAII style helper which makes it easier for subsystems to pause // VirtualTime is a headless feature which is intended to make renders (more)
// virtual time while performing an asynchronous operation. // deterministic by pausing task execution in the Blink main thread (and pausing
// the clock) while certain asynchronous operations are pending, e.g. fetching
// resources. Generally new instances of WebScopedVirtualTimePauser should only
// be added if there are determinism problems with renders on certain pages.
// The WebScopedVirtualTimePauser itself is a move only RAII style helper which
// makes it easier for subsystems to robustly pause and unpause virtual time.
class BLINK_PLATFORM_EXPORT WebScopedVirtualTimePauser { class BLINK_PLATFORM_EXPORT WebScopedVirtualTimePauser {
public: public:
enum class VirtualTaskDuration { enum class VirtualTaskDuration {
...@@ -25,6 +30,11 @@ class BLINK_PLATFORM_EXPORT WebScopedVirtualTimePauser { ...@@ -25,6 +30,11 @@ class BLINK_PLATFORM_EXPORT WebScopedVirtualTimePauser {
// Note simply creating a WebScopedVirtualTimePauser doesn't cause VirtualTime // Note simply creating a WebScopedVirtualTimePauser doesn't cause VirtualTime
// to pause, instead you need to call PauseVirtualTime. // to pause, instead you need to call PauseVirtualTime.
// By default VirtualTaskDuration::kInstant should be used unless there is a
// risk of virtual time getting stalled (e.g. if a page requests a
// non-existent resource and it has an error handler which always fetches
// another non-existent resource, then there is a risk that virtual time will
// be blocked forever unless we use VirtualTaskDuration::kNonInstant).
WebScopedVirtualTimePauser(scheduler::MainThreadSchedulerImpl*, WebScopedVirtualTimePauser(scheduler::MainThreadSchedulerImpl*,
VirtualTaskDuration, VirtualTaskDuration,
const WebString& debug_name); const WebString& debug_name);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment