Index: third_party/WebKit/Source/core/frame/FrameView.h |
diff --git a/third_party/WebKit/Source/core/frame/FrameView.h b/third_party/WebKit/Source/core/frame/FrameView.h |
index 55f071cafc334489d06d45c50113a5303dd18096..570c3caa3603b464aa6f563de83d28a6b5de65da 100644 |
--- a/third_party/WebKit/Source/core/frame/FrameView.h |
+++ b/third_party/WebKit/Source/core/frame/FrameView.h |
@@ -27,6 +27,7 @@ |
#include "core/CoreExport.h" |
#include "core/dom/DocumentLifecycle.h" |
+#include "core/dom/IntersectionObserverCallback.h" |
#include "core/frame/FrameViewAutoSizeInfo.h" |
#include "core/frame/LayoutSubtreeRootList.h" |
#include "core/frame/RootFrameViewport.h" |
@@ -591,9 +592,10 @@ public: |
// scheduling visual updates. |
bool canThrottleRendering() const; |
bool isHiddenForThrottling() const { return m_hiddenForThrottling; } |
+ void setupRenderThrottling(); |
// For testing, run pending intersection observer notifications for this frame. |
- void notifyRenderThrottlingObserversForTesting(); |
+ void updateRenderThrottlingStatusForTesting(); |
// Paint properties for SPv2 Only. |
void setPreTranslation(PassRefPtr<TransformPaintPropertyNode> preTranslation) { m_preTranslation = preTranslation; } |
@@ -668,6 +670,20 @@ protected: |
void invalidateTreeIfNeeded(const PaintInvalidationState&); |
private: |
+ class IntersectionObserverCallback : public blink::IntersectionObserverCallback { |
+ public: |
+ IntersectionObserverCallback(FrameView*); |
+ |
+ // IntersectionObserverCallback implementation: |
+ void handleEvent(const HeapVector<Member<IntersectionObserverEntry>>&, IntersectionObserver&) override; |
+ ExecutionContext* getExecutionContext() const override; |
+ |
+ DECLARE_TRACE(); |
+ |
+ private: |
+ Member<FrameView> m_frameView; |
szager1
2016/08/30 23:57:12
I think this should be WeakMember, to avoid a refe
Sami
2016/08/31 11:08:56
I guess I was thinking that with Oilpan in-heap re
|
+ }; |
+ |
explicit FrameView(LocalFrame*); |
void setScrollOffset(const DoublePoint&, ScrollType) override; |
@@ -778,9 +794,7 @@ private: |
void setNeedsUpdateViewportIntersection(); |
void updateViewportIntersectionsForSubtree(DocumentLifecycle::LifecycleState targetState); |
- void updateViewportIntersectionIfNeeded(); |
- void notifyRenderThrottlingObservers(); |
- void updateThrottlingStatus(); |
+ void updateRenderThrottlingStatus(bool hidden, bool subtreeThrottled); |
void notifyResizeObservers(); |
// PaintInvalidationCapableScrollableArea |
@@ -819,7 +833,6 @@ private: |
unsigned m_nestedLayoutCount; |
Timer<FrameView> m_postLayoutTasksTimer; |
Timer<FrameView> m_updateWidgetsTimer; |
- std::unique_ptr<CancellableTaskFactory> m_renderThrottlingObserverNotificationFactory; |
bool m_firstLayout; |
bool m_isTransparent; |
@@ -901,16 +914,10 @@ private: |
// main frame. |
Member<RootFrameViewport> m_viewportScrollableArea; |
- // This frame's bounds in the root frame's content coordinates, clipped |
- // recursively through every ancestor view. |
- IntRect m_viewportIntersection; |
- bool m_viewportIntersectionValid; |
- |
// The following members control rendering pipeline throttling for this |
// frame. They are only updated in response to intersection observer |
// notifications, i.e., not in the middle of the lifecycle. |
bool m_hiddenForThrottling; |
- bool m_crossOriginForThrottling; |
bool m_subtreeThrottled; |
// Paint properties for SPv2 Only. |
@@ -939,6 +946,8 @@ private: |
bool m_suppressAdjustViewSize; |
bool m_allowsLayoutInvalidationAfterLayoutClean; |
+ Member<IntersectionObserver> m_intersectionObserver; |
+ |
// For testing. |
struct ObjectPaintInvalidation { |
String name; |