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

Unified Diff: third_party/WebKit/Source/core/dom/DocumentLifecycle.h

Issue 2003993002: Disallow throttling while running requestAnimationFrame callbacks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/DocumentLifecycle.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/DocumentLifecycle.h
diff --git a/third_party/WebKit/Source/core/dom/DocumentLifecycle.h b/third_party/WebKit/Source/core/dom/DocumentLifecycle.h
index 6a2d1f062b5f4a44091d1b2a095fd74c25714231..b744be68a65bcca8d90c00c4d72e2ee6d54a0ae0 100644
--- a/third_party/WebKit/Source/core/dom/DocumentLifecycle.h
+++ b/third_party/WebKit/Source/core/dom/DocumentLifecycle.h
@@ -129,6 +129,10 @@ public:
DocumentLifecycle& m_documentLifecycle;
};
+ // Throttling is disabled by default. Instantiating this class allows
+ // throttling (e.g., during BeginMainFrame). If a script needs to run inside
+ // this scope, DisallowThrottlingScope should be used to let the script
+ // perform a synchronous layout if necessary.
class CORE_EXPORT AllowThrottlingScope {
STACK_ALLOCATED();
WTF_MAKE_NONCOPYABLE(AllowThrottlingScope);
@@ -137,6 +141,18 @@ public:
~AllowThrottlingScope();
};
+ class CORE_EXPORT DisallowThrottlingScope {
+ STACK_ALLOCATED();
+ WTF_MAKE_NONCOPYABLE(DisallowThrottlingScope);
+
+ public:
+ DisallowThrottlingScope(DocumentLifecycle&);
+ ~DisallowThrottlingScope();
+
+ private:
+ int m_savedCount;
+ };
+
DocumentLifecycle();
~DocumentLifecycle();
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/DocumentLifecycle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698