| 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();
|
|
|
|
|