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

Side by Side Diff: Source/core/frame/FrameView.h

Issue 1215973002: Oilpan: improve ScrollableArea handling. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: review-induced improvements Created 5 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/frame/FrameHost.cpp ('k') | Source/core/frame/FrameView.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 Copyright (C) 1997 Martin Jones (mjones@kde.org) 2 Copyright (C) 1997 Martin Jones (mjones@kde.org)
3 (C) 1998 Waldo Bastian (bastian@kde.org) 3 (C) 1998 Waldo Bastian (bastian@kde.org)
4 (C) 1998, 1999 Torben Weis (weis@kde.org) 4 (C) 1998, 1999 Torben Weis (weis@kde.org)
5 (C) 1999 Lars Knoll (knoll@kde.org) 5 (C) 1999 Lars Knoll (knoll@kde.org)
6 (C) 1999 Antti Koivisto (koivisto@kde.org) 6 (C) 1999 Antti Koivisto (koivisto@kde.org)
7 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed. 7 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed.
8 8
9 This library is free software; you can redistribute it and/or 9 This library is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Library General Public 10 modify it under the terms of the GNU Library General Public
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 class LayoutView; 65 class LayoutView;
66 class Page; 66 class Page;
67 class ScrollingCoordinator; 67 class ScrollingCoordinator;
68 class TracedValue; 68 class TracedValue;
69 struct AnnotatedRegionValue; 69 struct AnnotatedRegionValue;
70 struct CompositedSelection; 70 struct CompositedSelection;
71 71
72 typedef unsigned long long DOMTimeStamp; 72 typedef unsigned long long DOMTimeStamp;
73 73
74 class CORE_EXPORT FrameView final : public Widget, public ScrollableArea { 74 class CORE_EXPORT FrameView final : public Widget, public ScrollableArea {
75 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(FrameView);
75 public: 76 public:
76 friend class LayoutView; 77 friend class LayoutView;
77 friend class Internals; 78 friend class Internals;
78 79
79 static PassRefPtrWillBeRawPtr<FrameView> create(LocalFrame*); 80 static PassRefPtrWillBeRawPtr<FrameView> create(LocalFrame*);
80 static PassRefPtrWillBeRawPtr<FrameView> create(LocalFrame*, const IntSize& initialSize); 81 static PassRefPtrWillBeRawPtr<FrameView> create(LocalFrame*, const IntSize& initialSize);
81 82
82 virtual ~FrameView(); 83 virtual ~FrameView();
83 84
84 virtual void invalidateRect(const IntRect&) override; 85 virtual void invalidateRect(const IntRect&) override;
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 virtual void scrollbarStyleChanged() override; 282 virtual void scrollbarStyleChanged() override;
282 283
283 LayoutBox* embeddedContentBox() const; 284 LayoutBox* embeddedContentBox() const;
284 285
285 void setTracksPaintInvalidations(bool); 286 void setTracksPaintInvalidations(bool);
286 bool isTrackingPaintInvalidations() const { return m_isTrackingPaintInvalida tions; } 287 bool isTrackingPaintInvalidations() const { return m_isTrackingPaintInvalida tions; }
287 void resetTrackedPaintInvalidations(); 288 void resetTrackedPaintInvalidations();
288 289
289 String trackedPaintInvalidationRectsAsText() const; 290 String trackedPaintInvalidationRectsAsText() const;
290 291
291 typedef HashSet<ScrollableArea*> ScrollableAreaSet; 292 using ScrollableAreaSet = WillBeHeapHashSet<RawPtrWillBeMember<ScrollableAre a>>;
292 void addScrollableArea(ScrollableArea*); 293 void addScrollableArea(ScrollableArea*);
293 void removeScrollableArea(ScrollableArea*); 294 void removeScrollableArea(ScrollableArea*);
294 const ScrollableAreaSet* scrollableAreas() const { return m_scrollableAreas. get(); } 295 const ScrollableAreaSet* scrollableAreas() const { return m_scrollableAreas. get(); }
295 296
296 void addAnimatingScrollableArea(ScrollableArea*); 297 void addAnimatingScrollableArea(ScrollableArea*);
297 void removeAnimatingScrollableArea(ScrollableArea*); 298 void removeAnimatingScrollableArea(ScrollableArea*);
298 const ScrollableAreaSet* animatingScrollableAreas() const { return m_animati ngScrollableAreas.get(); } 299 const ScrollableAreaSet* animatingScrollableAreas() const { return m_animati ngScrollableAreas.get(); }
299 300
300 // With CSS style "resize:" enabled, a little resizer handle will appear at the bottom 301 // With CSS style "resize:" enabled, a little resizer handle will appear at the bottom
301 // right of the object. We keep track of these resizer areas for checking if touches 302 // right of the object. We keep track of these resizer areas for checking if touches
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
779 unsigned m_visuallyNonEmptyCharacterCount; 780 unsigned m_visuallyNonEmptyCharacterCount;
780 unsigned m_visuallyNonEmptyPixelCount; 781 unsigned m_visuallyNonEmptyPixelCount;
781 bool m_isVisuallyNonEmpty; 782 bool m_isVisuallyNonEmpty;
782 bool m_firstVisuallyNonEmptyLayoutCallbackPending; 783 bool m_firstVisuallyNonEmptyLayoutCallbackPending;
783 784
784 RefPtrWillBeMember<Node> m_maintainScrollPositionAnchor; 785 RefPtrWillBeMember<Node> m_maintainScrollPositionAnchor;
785 786
786 // layoutObject to hold our custom scroll corner. 787 // layoutObject to hold our custom scroll corner.
787 LayoutScrollbarPart* m_scrollCorner; 788 LayoutScrollbarPart* m_scrollCorner;
788 789
789 OwnPtr<ScrollableAreaSet> m_scrollableAreas; 790 OwnPtrWillBeMember<ScrollableAreaSet> m_scrollableAreas;
790 OwnPtr<ScrollableAreaSet> m_animatingScrollableAreas; 791 OwnPtrWillBeMember<ScrollableAreaSet> m_animatingScrollableAreas;
791 OwnPtr<ResizerAreaSet> m_resizerAreas; 792 OwnPtr<ResizerAreaSet> m_resizerAreas;
792 OwnPtr<ViewportConstrainedObjectSet> m_viewportConstrainedObjects; 793 OwnPtr<ViewportConstrainedObjectSet> m_viewportConstrainedObjects;
793 OwnPtrWillBeMember<FrameViewAutoSizeInfo> m_autoSizeInfo; 794 OwnPtrWillBeMember<FrameViewAutoSizeInfo> m_autoSizeInfo;
794 795
795 IntSize m_inputEventsOffsetForEmulation; 796 IntSize m_inputEventsOffsetForEmulation;
796 float m_inputEventsScaleFactorForEmulation; 797 float m_inputEventsScaleFactorForEmulation;
797 798
798 IntSize m_layoutSize; 799 IntSize m_layoutSize;
799 bool m_layoutSizeFixedToFrameSize; 800 bool m_layoutSizeFixedToFrameSize;
800 801
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
836 IntPoint m_panScrollIconPoint; 837 IntPoint m_panScrollIconPoint;
837 bool m_shouldDrawPanScrollIcon; 838 bool m_shouldDrawPanScrollIcon;
838 839
839 bool m_clipsRepaints; 840 bool m_clipsRepaints;
840 841
841 OwnPtr<LayoutAnalyzer> m_analyzer; 842 OwnPtr<LayoutAnalyzer> m_analyzer;
842 843
843 // Exists only on root frame. 844 // Exists only on root frame.
844 // TODO(bokan): crbug.com/484188. We should specialize FrameView for the 845 // TODO(bokan): crbug.com/484188. We should specialize FrameView for the
845 // main frame. 846 // main frame.
846 OwnPtr<ScrollableArea> m_viewportScrollableArea; 847 OwnPtrWillBeMember<ScrollableArea> m_viewportScrollableArea;
847 }; 848 };
848 849
849 inline void FrameView::incrementVisuallyNonEmptyCharacterCount(unsigned count) 850 inline void FrameView::incrementVisuallyNonEmptyCharacterCount(unsigned count)
850 { 851 {
851 if (m_isVisuallyNonEmpty) 852 if (m_isVisuallyNonEmpty)
852 return; 853 return;
853 m_visuallyNonEmptyCharacterCount += count; 854 m_visuallyNonEmptyCharacterCount += count;
854 // Use a threshold value to prevent very small amounts of visible content fr om triggering didFirstVisuallyNonEmptyLayout. 855 // Use a threshold value to prevent very small amounts of visible content fr om triggering didFirstVisuallyNonEmptyLayout.
855 // The first few hundred characters rarely contain the interesting content o f the page. 856 // The first few hundred characters rarely contain the interesting content o f the page.
856 static const unsigned visualCharacterThreshold = 200; 857 static const unsigned visualCharacterThreshold = 200;
(...skipping 10 matching lines...) Expand all
867 static const unsigned visualPixelThreshold = 32 * 32; 868 static const unsigned visualPixelThreshold = 32 * 32;
868 if (m_visuallyNonEmptyPixelCount > visualPixelThreshold) 869 if (m_visuallyNonEmptyPixelCount > visualPixelThreshold)
869 setIsVisuallyNonEmpty(); 870 setIsVisuallyNonEmpty();
870 } 871 }
871 872
872 DEFINE_TYPE_CASTS(FrameView, Widget, widget, widget->isFrameView(), widget.isFra meView()); 873 DEFINE_TYPE_CASTS(FrameView, Widget, widget, widget->isFrameView(), widget.isFra meView());
873 874
874 } // namespace blink 875 } // namespace blink
875 876
876 #endif // FrameView_h 877 #endif // FrameView_h
OLDNEW
« no previous file with comments | « Source/core/frame/FrameHost.cpp ('k') | Source/core/frame/FrameView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698