Index: Source/core/frame/FrameView.h |
diff --git a/Source/core/frame/FrameView.h b/Source/core/frame/FrameView.h |
index a1b2b4383ff62b44434aa193bdc964110947d04a..65a58bbdb3d3a33573d8f3d4aba881c8cee8d7f2 100644 |
--- a/Source/core/frame/FrameView.h |
+++ b/Source/core/frame/FrameView.h |
@@ -226,11 +226,14 @@ public: |
Color documentBackgroundColor() const; |
// Run all needed lifecycle stages. After calling this method, all frames will be in the lifecycle state PaintInvalidationClean. |
- void updateAllLifecyclePhases(); |
+ // If lifecycle throttling is allowed, some frames may skip the lifecycle update (e.g., based on visibility) and will not end |
+ // up being PaintInvalidationClean. |
+ enum class LifecycleThrottlingMode { Disallow, Allow }; |
+ void updateAllLifecyclePhases(LifecycleThrottlingMode = LifecycleThrottlingMode::Disallow); |
// Computes the style, layout and compositing lifecycle stages if needed. After calling this method, all frames wil lbe in a lifecycle |
// state >= CompositingClean, and scrolling has been updated. |
- void updateLifecycleToCompositingCleanPlusScrolling(); |
+ void updateLifecycleToCompositingCleanPlusScrolling(LifecycleThrottlingMode = LifecycleThrottlingMode::Disallow); |
bool invalidateViewportConstrainedObjects(); |
@@ -559,6 +562,19 @@ public: |
void setFrameTimingRequestsDirty(bool isDirty) { m_frameTimingRequestsDirty = isDirty; } |
bool frameTimingRequestsDirty() { return m_frameTimingRequestsDirty; } |
+ // Returns true if this frame should skip rendering pipeline processing during the |
+ // current BeginMainFrame. |
+ bool shouldThrottleRenderingPipeline() const; |
+ |
+ // Returns true if this frame should skip style computation, layout and |
+ // compositing updates for the current BeginMainFrame. |
+ bool shouldThrottleStyleLayoutAndCompositingUpdates() const; |
+ |
+ // Updates the throttling status of all frames in the hierarchy and |
+ // schedules new animations or lifecycle updates as necessary. Must be |
+ // called after the layer update phase of the current BeginMainFrame. |
+ void updateThrottling(); |
+ |
protected: |
// Scroll the content via the compositor. |
bool scrollContentsFastPath(const IntSize& scrollDelta); |
@@ -612,7 +628,7 @@ private: |
OnlyUpToCompositingCleanPlusScrolling, |
}; |
- void updateLifecyclePhasesInternal(LifeCycleUpdateOption); |
+ void updateLifecyclePhasesInternal(LifeCycleUpdateOption, LifecycleThrottlingMode); |
void invalidateTreeIfNeededRecursive(); |
void scrollContentsIfNeededRecursive(); |
void updateStyleAndLayoutIfNeededRecursive(); |
@@ -717,6 +733,10 @@ private: |
void collectFrameTimingRequests(GraphicsLayerFrameTimingRequests&); |
void collectFrameTimingRequestsRecursive(GraphicsLayerFrameTimingRequests&); |
+ void computeViewportVisibility(); |
+ void setLifecycleThrottlingModeRecursive(LifecycleThrottlingMode); |
+ void updateThrottlingRecursive(bool hasCrossedSecurityOrigin); |
+ |
LayoutSize m_size; |
typedef HashSet<RefPtr<LayoutEmbeddedObject>> EmbeddedObjectSet; |
@@ -839,6 +859,15 @@ private: |
// TODO(bokan): crbug.com/484188. We should specialize FrameView for the |
// main frame. |
OwnPtrWillBeMember<ScrollableArea> m_viewportScrollableArea; |
+ |
+ LifecycleThrottlingMode m_lifecycleThrottlingMode; |
+ // This frame's bounds in the root frame's content coordinates, clipped recursively through every ancestor view. |
+ IntRect m_clippedBounds; |
+ |
+ enum class ViewportVisibility { Hidden, Visible, Unknown }; |
+ ViewportVisibility m_viewportVisibility; |
+ ViewportVisibility m_viewportVisibilityForThrottling; |
ojan
2015/09/01 19:56:48
This member deserves a comment explaining why we n
Sami
2015/09/02 10:46:02
Definitely agreed. Added a comment.
|
+ bool m_isCrossOriginForThrottling; |
}; |
inline void FrameView::incrementVisuallyNonEmptyCharacterCount(unsigned count) |