diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-12 14:27:29 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-13 09:35:20 +0000 |
commit | c30a6232df03e1efbd9f3b226777b07e087a1122 (patch) | |
tree | e992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/third_party/blink/renderer/core/page/page.h | |
parent | 7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff) | |
download | qtwebengine-chromium-85-based.tar.gz |
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/third_party/blink/renderer/core/page/page.h')
-rw-r--r-- | chromium/third_party/blink/renderer/core/page/page.h | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/chromium/third_party/blink/renderer/core/page/page.h b/chromium/third_party/blink/renderer/core/page/page.h index 181c13e9e6e..d397e83eb4d 100644 --- a/chromium/third_party/blink/renderer/core/page/page.h +++ b/chromium/third_party/blink/renderer/core/page/page.h @@ -246,6 +246,10 @@ class CORE_EXPORT Page final : public GarbageCollected<Page>, bool Paused() const { return paused_; } void SetPaused(bool); + // Frozen state corresponds to "lifecycle state for CPU suspension" + // https://wicg.github.io/page-lifecycle/#sec-lifecycle-states + bool Frozen() const { return frozen_; } + void SetPageScaleFactor(float); float PageScaleFactor() const; @@ -270,16 +274,13 @@ class CORE_EXPORT Page final : public GarbageCollected<Page>, mojom::blink::PageVisibilityState GetVisibilityState() const; bool IsPageVisible() const; - PageLifecycleState LifecycleState() const; - bool IsCursorVisible() const; void SetIsCursorVisible(bool is_visible) { is_cursor_visible_ = is_visible; } // Don't allow more than a certain number of frames in a page. - // This seems like a reasonable upper bound, and otherwise mutually - // recursive frameset pages can quickly bring the program to its knees - // with exponential growth in the number of frames. - static const int kMaxNumberOfFrames = 1000; + static int MaxNumberOfFrames(); + static void SetMaxNumberOfFramesToTenForTesting(bool enabled); + void IncrementSubframeCount() { ++subframe_count_; } void DecrementSubframeCount() { DCHECK_GT(subframe_count_, 0); @@ -300,7 +301,7 @@ class CORE_EXPORT Page final : public GarbageCollected<Page>, void AcceptLanguagesChanged(); - void Trace(Visitor*) override; + void Trace(Visitor*) const override; void AnimationHostInitialized(cc::AnimationHost&, LocalFrameView*); void WillCloseAnimationHost(LocalFrameView*); @@ -317,7 +318,7 @@ class CORE_EXPORT Page final : public GarbageCollected<Page>, bool IsOrdinary() const override; void ReportIntervention(const String& message) override; bool RequestBeginMainFrameNotExpected(bool new_state) override; - void SetLifecycleState(PageLifecycleState) override; + void OnSetPageFrozen(bool is_frozen) override; bool LocalMainFrameNetworkIsAlmostIdle() const override; void AddAutoplayFlags(int32_t flags); @@ -425,7 +426,6 @@ class CORE_EXPORT Page final : public GarbageCollected<Page>, bool is_closing_; bool tab_key_cycles_through_elements_; - bool paused_; float device_scale_factor_; @@ -433,10 +433,16 @@ class CORE_EXPORT Page final : public GarbageCollected<Page>, bool is_ordinary_; - PageLifecycleState page_lifecycle_state_; - bool is_cursor_visible_; + // See Page::Paused and Page::Frozen for the detailed description of paused + // and frozen state. The main distinction is that "frozen" state is + // web-exposed (onfreeze / onresume) and controlled from the browser process, + // while "paused" state is an implementation detail of handling sync IPCs and + // controlled from the renderer. + bool paused_ = false; + bool frozen_ = false; + #if DCHECK_IS_ON() bool is_painting_ = false; #endif |