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

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

Issue 603193005: Move the Widget hierarchy to the Oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased upto r183571 Created 6 years, 2 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
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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 class RenderBox; 56 class RenderBox;
57 class RenderEmbeddedObject; 57 class RenderEmbeddedObject;
58 class RenderObject; 58 class RenderObject;
59 class RenderPart; 59 class RenderPart;
60 class RenderScrollbarPart; 60 class RenderScrollbarPart;
61 class RenderView; 61 class RenderView;
62 struct CompositedSelectionBound; 62 struct CompositedSelectionBound;
63 63
64 typedef unsigned long long DOMTimeStamp; 64 typedef unsigned long long DOMTimeStamp;
65 65
66 // FIXME: Oilpan: move Widget (and thereby FrameView) to the heap.
67 class FrameView final : public Widget, public ScrollableArea { 66 class FrameView final : public Widget, public ScrollableArea {
68 public: 67 public:
69 friend class RenderView; 68 friend class RenderView;
70 friend class Internals; 69 friend class Internals;
71 70
72 static PassRefPtr<FrameView> create(LocalFrame*); 71 static PassRefPtrWillBeRawPtr<FrameView> create(LocalFrame*);
73 static PassRefPtr<FrameView> create(LocalFrame*, const IntSize& initialSize) ; 72 static PassRefPtrWillBeRawPtr<FrameView> create(LocalFrame*, const IntSize& initialSize);
74 73
75 virtual ~FrameView(); 74 virtual ~FrameView();
76 75
77 virtual void invalidateRect(const IntRect&) override; 76 virtual void invalidateRect(const IntRect&) override;
78 virtual void setFrameRect(const IntRect&) override; 77 virtual void setFrameRect(const IntRect&) override;
79 78
80 LocalFrame& frame() const 79 LocalFrame& frame() const
81 { 80 {
82 ASSERT(m_frame); 81 ASSERT(m_frame);
83 return *m_frame; 82 return *m_frame;
84 } 83 }
85 84
86 Page* page() const; 85 Page* page() const;
87 86
88 RenderView* renderView() const; 87 RenderView* renderView() const;
89 88
90 void setCanHaveScrollbars(bool); 89 void setCanHaveScrollbars(bool);
91 90
92 PassRefPtr<Scrollbar> createScrollbar(ScrollbarOrientation); 91 PassRefPtrWillBeRawPtr<Scrollbar> createScrollbar(ScrollbarOrientation);
93 92
94 void setContentsSize(const IntSize&); 93 void setContentsSize(const IntSize&);
95 IntPoint clampOffsetAtScale(const IntPoint& offset, float scale) const; 94 IntPoint clampOffsetAtScale(const IntPoint& offset, float scale) const;
96 95
97 void layout(bool allowSubtree = true); 96 void layout(bool allowSubtree = true);
98 bool didFirstLayout() const; 97 bool didFirstLayout() const;
99 void scheduleRelayout(); 98 void scheduleRelayout();
100 void scheduleRelayoutOfSubtree(RenderObject*); 99 void scheduleRelayoutOfSubtree(RenderObject*);
101 bool layoutPending() const; 100 bool layoutPending() const;
102 bool isInPerformLayout() const; 101 bool isInPerformLayout() const;
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 221
223 void updateLayoutAndStyleForPainting(); 222 void updateLayoutAndStyleForPainting();
224 void updateLayoutAndStyleIfNeededRecursive(); 223 void updateLayoutAndStyleIfNeededRecursive();
225 224
226 void invalidateTreeIfNeededRecursive(); 225 void invalidateTreeIfNeededRecursive();
227 226
228 void incrementVisuallyNonEmptyCharacterCount(unsigned); 227 void incrementVisuallyNonEmptyCharacterCount(unsigned);
229 void incrementVisuallyNonEmptyPixelCount(const IntSize&); 228 void incrementVisuallyNonEmptyPixelCount(const IntSize&);
230 void setIsVisuallyNonEmpty() { m_isVisuallyNonEmpty = true; } 229 void setIsVisuallyNonEmpty() { m_isVisuallyNonEmpty = true; }
231 void enableAutoSizeMode(const IntSize& minSize, const IntSize& maxSize); 230 void enableAutoSizeMode(const IntSize& minSize, const IntSize& maxSize);
232 void disableAutoSizeMode() { m_autoSizeInfo.clear(); } 231 void disableAutoSizeMode() { disposeAutoSizeInfo(); }
233 232
234 void forceLayout(bool allowSubtree = false); 233 void forceLayout(bool allowSubtree = false);
235 void forceLayoutForPagination(const FloatSize& pageSize, const FloatSize& or iginalPageSize, float maximumShrinkFactor); 234 void forceLayoutForPagination(const FloatSize& pageSize, const FloatSize& or iginalPageSize, float maximumShrinkFactor);
236 235
237 bool scrollToFragment(const KURL&); 236 bool scrollToFragment(const KURL&);
238 bool scrollToAnchor(const String&); 237 bool scrollToAnchor(const String&);
239 void maintainScrollPositionAtAnchor(Node*); 238 void maintainScrollPositionAtAnchor(Node*);
240 void scrollElementToRect(Element*, const IntRect&); 239 void scrollElementToRect(Element*, const IntRect&);
241 void scrollContentsIfNeededRecursive(); 240 void scrollContentsIfNeededRecursive();
242 241
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 346
348 void notifyPageThatContentAreaWillPaintInternal() const; 347 void notifyPageThatContentAreaWillPaintInternal() const;
349 348
350 // The window that hosts the ScrollView. The ScrollView will communicate scr olls and repaints to the 349 // The window that hosts the ScrollView. The ScrollView will communicate scr olls and repaints to the
351 // host window in the window's coordinate space. 350 // host window in the window's coordinate space.
352 HostWindow* hostWindow() const; 351 HostWindow* hostWindow() const;
353 352
354 // Returns a clip rect in host window coordinates. Used to clip the blit on a scroll. 353 // Returns a clip rect in host window coordinates. Used to clip the blit on a scroll.
355 IntRect windowClipRect(IncludeScrollbarsInRect = ExcludeScrollbars) const; 354 IntRect windowClipRect(IncludeScrollbarsInRect = ExcludeScrollbars) const;
356 355
356 typedef WillBeHeapHashSet<RefPtrWillBeMember<Widget> > ChildrenWidgetSet;
357
357 // Functions for child manipulation and inspection. 358 // Functions for child manipulation and inspection.
358 const HashSet<RefPtr<Widget> >* children() const { return &m_children; } 359 const ChildrenWidgetSet* children() const { return &m_children; }
359 void addChild(PassRefPtr<Widget>); 360 void addChild(PassRefPtrWillBeRawPtr<Widget>);
360 void removeChildInternal(Widget*); 361 void removeChildInternal(Widget*);
361 362
362 // If the scroll view does not use a native widget, then it will have cross- platform Scrollbars. These functions 363 // If the scroll view does not use a native widget, then it will have cross- platform Scrollbars. These functions
363 // can be used to obtain those scrollbars. 364 // can be used to obtain those scrollbars.
364 virtual Scrollbar* horizontalScrollbar() const override { return m_horizonta lScrollbar.get(); } 365 virtual Scrollbar* horizontalScrollbar() const override { return m_horizonta lScrollbar.get(); }
365 virtual Scrollbar* verticalScrollbar() const override { return m_verticalScr ollbar.get(); } 366 virtual Scrollbar* verticalScrollbar() const override { return m_verticalScr ollbar.get(); }
366 virtual bool isScrollViewScrollbar(const Widget* child) const override { ret urn horizontalScrollbar() == child || verticalScrollbar() == child; } 367 virtual bool isScrollViewScrollbar(const Widget* child) const override { ret urn horizontalScrollbar() == child || verticalScrollbar() == child; }
367 368
368 void positionScrollbarLayers(); 369 void positionScrollbarLayers();
369 370
(...skipping 18 matching lines...) Expand all
388 389
389 void setCanHaveScrollbarsInternal(bool); 390 void setCanHaveScrollbarsInternal(bool);
390 bool canHaveScrollbars() const { return horizontalScrollbarMode() != Scrollb arAlwaysOff || verticalScrollbarMode() != ScrollbarAlwaysOff; } 391 bool canHaveScrollbars() const { return horizontalScrollbarMode() != Scrollb arAlwaysOff || verticalScrollbarMode() != ScrollbarAlwaysOff; }
391 392
392 // By default, paint events are clipped to the visible area. If set to 393 // By default, paint events are clipped to the visible area. If set to
393 // false, paint events are no longer clipped. 394 // false, paint events are no longer clipped.
394 bool clipsPaintInvalidations() const { return m_clipsRepaints; } 395 bool clipsPaintInvalidations() const { return m_clipsRepaints; }
395 void setClipsRepaints(bool); 396 void setClipsRepaints(bool);
396 397
397 // Overridden by FrameView to create custom CSS scrollbars if applicable. 398 // Overridden by FrameView to create custom CSS scrollbars if applicable.
398 PassRefPtr<Scrollbar> createScrollbarInternal(ScrollbarOrientation); 399 PassRefPtrWillBeRawPtr<Scrollbar> createScrollbarInternal(ScrollbarOrientati on);
399 400
400 // The visible content rect has a location that is the scrolled offset of th e document. The width and height are the viewport width 401 // The visible content rect has a location that is the scrolled offset of th e document. The width and height are the viewport width
401 // and height. By default the scrollbars themselves are excluded from this r ectangle, but an optional boolean argument allows them to be 402 // and height. By default the scrollbars themselves are excluded from this r ectangle, but an optional boolean argument allows them to be
402 // included. 403 // included.
403 virtual IntRect visibleContentRect(IncludeScrollbarsInRect = ExcludeScrollba rs) const override; 404 virtual IntRect visibleContentRect(IncludeScrollbarsInRect = ExcludeScrollba rs) const override;
404 IntSize visibleSize() const { return visibleContentRect().size(); } 405 IntSize visibleSize() const { return visibleContentRect().size(); }
405 406
406 // visibleContentRect().size() is computed from unscaledVisibleContentSize() divided by the value of visibleContentScaleFactor. 407 // visibleContentRect().size() is computed from unscaledVisibleContentSize() divided by the value of visibleContentScaleFactor.
407 // For the main frame, visibleContentScaleFactor is equal to the page's page ScaleFactor; it's 1 otherwise. 408 // For the main frame, visibleContentScaleFactor is equal to the page's page ScaleFactor; it's 1 otherwise.
408 IntSize unscaledVisibleContentSize(IncludeScrollbarsInRect = ExcludeScrollba rs) const; 409 IntSize unscaledVisibleContentSize(IncludeScrollbarsInRect = ExcludeScrollba rs) const;
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 virtual IntRect convertFromContainingViewToScrollbar(const Scrollbar*, const IntRect&) const override; 537 virtual IntRect convertFromContainingViewToScrollbar(const Scrollbar*, const IntRect&) const override;
537 virtual IntPoint convertFromScrollbarToContainingView(const Scrollbar*, cons t IntPoint&) const override; 538 virtual IntPoint convertFromScrollbarToContainingView(const Scrollbar*, cons t IntPoint&) const override;
538 virtual IntPoint convertFromContainingViewToScrollbar(const Scrollbar*, cons t IntPoint&) const override; 539 virtual IntPoint convertFromContainingViewToScrollbar(const Scrollbar*, cons t IntPoint&) const override;
539 540
540 void calculateAndPaintOverhangAreas(GraphicsContext*, const IntRect& dirtyRe ct); 541 void calculateAndPaintOverhangAreas(GraphicsContext*, const IntRect& dirtyRe ct);
541 void calculateAndPaintOverhangBackground(GraphicsContext*, const IntRect& di rtyRect); 542 void calculateAndPaintOverhangBackground(GraphicsContext*, const IntRect& di rtyRect);
542 543
543 virtual bool isScrollView() const override final { return true; } 544 virtual bool isScrollView() const override final { return true; }
544 virtual bool isFrameView() const override { return true; } 545 virtual bool isFrameView() const override { return true; }
545 546
547 virtual void trace(Visitor*) override;
548
546 protected: 549 protected:
547 bool scrollContentsFastPath(const IntSize& scrollDelta); 550 bool scrollContentsFastPath(const IntSize& scrollDelta);
548 void scrollContentsSlowPath(const IntRect& updateRect); 551 void scrollContentsSlowPath(const IntRect& updateRect);
549 552
550 bool isVerticalDocument() const; 553 bool isVerticalDocument() const;
551 bool isFlippedDocument() const; 554 bool isFlippedDocument() const;
552 555
553 // Prevents creation of scrollbars. Used to prevent drawing two sets of 556 // Prevents creation of scrollbars. Used to prevent drawing two sets of
554 // overlay scrollbars in the case of the pinch viewport. 557 // overlay scrollbars in the case of the pinch viewport.
555 bool scrollbarsDisabled() const; 558 bool scrollbarsDisabled() const;
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 { } 604 { }
602 private: 605 private:
603 TemporaryChange<bool> m_scope; 606 TemporaryChange<bool> m_scope;
604 }; 607 };
605 608
606 bool scrollbarsDisabledInternal() const { return false; } 609 bool scrollbarsDisabledInternal() const { return false; }
607 610
608 private: 611 private:
609 explicit FrameView(LocalFrame*); 612 explicit FrameView(LocalFrame*);
610 613
614 void dispose();
611 void reset(); 615 void reset();
612 void init(); 616 void init();
613 617
614 virtual void frameRectsChanged() override; 618 virtual void frameRectsChanged() override;
615 619
616 friend class RenderPart; 620 friend class RenderPart;
617 621
618 bool contentsInCompositedLayer() const; 622 bool contentsInCompositedLayer() const;
619 623
620 void applyOverflowToViewportAndSetRenderer(RenderObject*, ScrollbarMode& hMo de, ScrollbarMode& vMode); 624 void applyOverflowToViewportAndSetRenderer(RenderObject*, ScrollbarMode& hMo de, ScrollbarMode& vMode);
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 675
672 void updateScrollCorner(); 676 void updateScrollCorner();
673 677
674 FrameView* parentFrameView() const; 678 FrameView* parentFrameView() const;
675 679
676 AXObjectCache* axObjectCache() const; 680 AXObjectCache* axObjectCache() const;
677 void removeFromAXObjectCache(); 681 void removeFromAXObjectCache();
678 682
679 void setLayoutSizeInternal(const IntSize&); 683 void setLayoutSizeInternal(const IntSize&);
680 684
685 void disposeAutoSizeInfo();
686
681 bool paintInvalidationIsAllowed() const 687 bool paintInvalidationIsAllowed() const
682 { 688 {
683 return !isInPerformLayout() || canInvalidatePaintDuringPerformLayout(); 689 return !isInPerformLayout() || canInvalidatePaintDuringPerformLayout();
684 } 690 }
685 691
686 static double s_currentFrameTimeStamp; // used for detecting decoded resourc e thrash in the cache 692 static double s_currentFrameTimeStamp; // used for detecting decoded resourc e thrash in the cache
687 static bool s_inPaintContents; 693 static bool s_inPaintContents;
688 694
689 LayoutSize m_size; 695 LayoutSize m_size;
690 696
691 typedef WillBeHeapHashSet<RefPtrWillBeMember<RenderEmbeddedObject> > Embedde dObjectSet; 697 typedef WillBeHeapHashSet<RefPtrWillBeMember<RenderEmbeddedObject> > Embedde dObjectSet;
692 WillBePersistentHeapHashSet<RefPtrWillBeMember<RenderEmbeddedObject> > m_par tUpdateSet; 698 WillBeHeapHashSet<RefPtrWillBeMember<RenderEmbeddedObject> > m_partUpdateSet ;
693 699
694 // FIXME: These are just "children" of the FrameView and should be RefPtr<Wi dget> instead. 700 // FIXME: These are just "children" of the FrameView and should be RefPtrWil lBeMember<Widget> instead.
695 WillBePersistentHeapHashSet<RefPtrWillBeMember<RenderPart> > m_parts; 701 WillBeHeapHashSet<RefPtrWillBeMember<RenderPart> > m_parts;
696 702
697 // Oilpan: the use of a persistent back reference 'emulates' the 703 // The RefPtr cycle between LocalFrame and FrameView is broken
698 // RefPtr-cycle that is kept between the two objects non-Oilpan. 704 // when a LocalFrame is detached by FrameLoader::detachFromParent().
705 // It clears the LocalFrame's m_view reference via setView(nullptr).
699 // 706 //
700 // That cycle is broken when a LocalFrame is detached by 707 // For Oilpan, Member reference cycles pose no problem, but
701 // FrameLoader::detachFromParent(), it then clears its 708 // LocalFrame's FrameView is also cleared by setView(). This additionally
702 // FrameView's m_frame reference by calling setView(nullptr). 709 // triggers FrameView::dispose(), which performs the operations
703 RefPtrWillBePersistent<LocalFrame> m_frame; 710 // that cannot be delayed until finalization time.
711 RefPtrWillBeMember<LocalFrame> m_frame;
704 712
705 bool m_doFullPaintInvalidation; 713 bool m_doFullPaintInvalidation;
706 714
707 bool m_canHaveScrollbars; 715 bool m_canHaveScrollbars;
708 unsigned m_slowRepaintObjectCount; 716 unsigned m_slowRepaintObjectCount;
709 717
710 bool m_hasPendingLayout; 718 bool m_hasPendingLayout;
711 RenderObject* m_layoutSubtreeRoot; 719 RenderObject* m_layoutSubtreeRoot;
712 720
713 bool m_layoutSchedulingEnabled; 721 bool m_layoutSchedulingEnabled;
(...skipping 22 matching lines...) Expand all
736 744
737 bool m_wasScrolledByUser; 745 bool m_wasScrolledByUser;
738 bool m_inProgrammaticScroll; 746 bool m_inProgrammaticScroll;
739 bool m_safeToPropagateScrollToParent; 747 bool m_safeToPropagateScrollToParent;
740 748
741 double m_lastPaintTime; 749 double m_lastPaintTime;
742 750
743 bool m_isTrackingPaintInvalidations; // Used for testing. 751 bool m_isTrackingPaintInvalidations; // Used for testing.
744 Vector<IntRect> m_trackedPaintInvalidationRects; 752 Vector<IntRect> m_trackedPaintInvalidationRects;
745 753
746 RefPtrWillBePersistent<Node> m_nodeToDraw; 754 RefPtrWillBeMember<Node> m_nodeToDraw;
747 PaintBehavior m_paintBehavior; 755 PaintBehavior m_paintBehavior;
748 bool m_isPainting; 756 bool m_isPainting;
749 757
750 unsigned m_visuallyNonEmptyCharacterCount; 758 unsigned m_visuallyNonEmptyCharacterCount;
751 unsigned m_visuallyNonEmptyPixelCount; 759 unsigned m_visuallyNonEmptyPixelCount;
752 bool m_isVisuallyNonEmpty; 760 bool m_isVisuallyNonEmpty;
753 bool m_firstVisuallyNonEmptyLayoutCallbackPending; 761 bool m_firstVisuallyNonEmptyLayoutCallbackPending;
754 762
755 RefPtrWillBePersistent<Node> m_maintainScrollPositionAnchor; 763 RefPtrWillBeMember<Node> m_maintainScrollPositionAnchor;
756 764
757 // Renderer to hold our custom scroll corner. 765 // Renderer to hold our custom scroll corner.
758 RawPtrWillBePersistent<RenderScrollbarPart> m_scrollCorner; 766 RawPtrWillBeMember<RenderScrollbarPart> m_scrollCorner;
759 767
760 OwnPtr<ScrollableAreaSet> m_scrollableAreas; 768 OwnPtr<ScrollableAreaSet> m_scrollableAreas;
761 OwnPtr<ResizerAreaSet> m_resizerAreas; 769 OwnPtr<ResizerAreaSet> m_resizerAreas;
762 OwnPtr<ViewportConstrainedObjectSet> m_viewportConstrainedObjects; 770 OwnPtr<ViewportConstrainedObjectSet> m_viewportConstrainedObjects;
763 OwnPtr<FrameViewAutoSizeInfo> m_autoSizeInfo; 771 OwnPtrWillBeMember<FrameViewAutoSizeInfo> m_autoSizeInfo;
764 772
765 float m_visibleContentScaleFactor; 773 float m_visibleContentScaleFactor;
766 IntSize m_inputEventsOffsetForEmulation; 774 IntSize m_inputEventsOffsetForEmulation;
767 float m_inputEventsScaleFactorForEmulation; 775 float m_inputEventsScaleFactorForEmulation;
768 776
769 IntSize m_layoutSize; 777 IntSize m_layoutSize;
770 bool m_layoutSizeFixedToFrameSize; 778 bool m_layoutSizeFixedToFrameSize;
771 779
772 Timer<FrameView> m_didScrollTimer; 780 Timer<FrameView> m_didScrollTimer;
773 781
774 Vector<IntRect> m_tickmarks; 782 Vector<IntRect> m_tickmarks;
775 783
784 float m_topControlsViewportAdjustment;
785
776 bool m_needsUpdateWidgetPositions; 786 bool m_needsUpdateWidgetPositions;
777 float m_topControlsViewportAdjustment; 787
788 #if ENABLE(OILPAN) && ENABLE(ASSERT)
789 // Verified when finalizing.
790 bool m_hasBeenDisposed;
791 #endif
778 792
779 // --- ScrollView --- 793 // --- ScrollView ---
780 bool adjustScrollbarExistence(ComputeScrollbarExistenceOption = FirstPass); 794 bool adjustScrollbarExistence(ComputeScrollbarExistenceOption = FirstPass);
781 void adjustScrollbarOpacity(); 795 void adjustScrollbarOpacity();
782 // FIXME(bokan): setScrollOffset, setScrollPosition, scrollTo, scrollToOffse tWithoutAnimation, 796 // FIXME(bokan): setScrollOffset, setScrollPosition, scrollTo, scrollToOffse tWithoutAnimation,
783 // notifyScrollPositionChanged...there's too many ways to scroll this class. This needs 797 // notifyScrollPositionChanged...there's too many ways to scroll this class. This needs
784 // some cleanup. 798 // some cleanup.
785 void setScrollOffsetFromUpdateScrollbars(const DoubleSize&); 799 void setScrollOffsetFromUpdateScrollbars(const DoubleSize&);
786 800
787 RefPtr<Scrollbar> m_horizontalScrollbar; 801 RefPtrWillBeMember<Scrollbar> m_horizontalScrollbar;
788 RefPtr<Scrollbar> m_verticalScrollbar; 802 RefPtrWillBeMember<Scrollbar> m_verticalScrollbar;
789 ScrollbarMode m_horizontalScrollbarMode; 803 ScrollbarMode m_horizontalScrollbarMode;
790 ScrollbarMode m_verticalScrollbarMode; 804 ScrollbarMode m_verticalScrollbarMode;
791 805
792 bool m_horizontalScrollbarLock; 806 bool m_horizontalScrollbarLock;
793 bool m_verticalScrollbarLock; 807 bool m_verticalScrollbarLock;
794 808
795 HashSet<RefPtr<Widget> > m_children; 809 ChildrenWidgetSet m_children;
796 810
797 DoubleSize m_pendingScrollDelta; 811 DoubleSize m_pendingScrollDelta;
798 DoublePoint m_scrollPosition; 812 DoublePoint m_scrollPosition;
799 DoublePoint m_cachedScrollPosition; 813 DoublePoint m_cachedScrollPosition;
800 IntSize m_contentsSize; 814 IntSize m_contentsSize;
801 815
802 int m_scrollbarsAvoidingResizer; 816 int m_scrollbarsAvoidingResizer;
803 bool m_scrollbarsSuppressed; 817 bool m_scrollbarsSuppressed;
804 818
805 bool m_inUpdateScrollbars; 819 bool m_inUpdateScrollbars;
(...skipping 28 matching lines...) Expand all
834 m_visuallyNonEmptyPixelCount += size.width() * size.height(); 848 m_visuallyNonEmptyPixelCount += size.width() * size.height();
835 // Use a threshold value to prevent very small amounts of visible content fr om triggering didFirstVisuallyNonEmptyLayout 849 // Use a threshold value to prevent very small amounts of visible content fr om triggering didFirstVisuallyNonEmptyLayout
836 static const unsigned visualPixelThreshold = 32 * 32; 850 static const unsigned visualPixelThreshold = 32 * 32;
837 if (m_visuallyNonEmptyPixelCount > visualPixelThreshold) 851 if (m_visuallyNonEmptyPixelCount > visualPixelThreshold)
838 setIsVisuallyNonEmpty(); 852 setIsVisuallyNonEmpty();
839 } 853 }
840 854
841 DEFINE_TYPE_CASTS(FrameView, Widget, widget, widget->isFrameView(), widget.isFra meView()); 855 DEFINE_TYPE_CASTS(FrameView, Widget, widget, widget->isFrameView(), widget.isFra meView());
842 856
843 class AllowPaintInvalidationScope { 857 class AllowPaintInvalidationScope {
858 STACK_ALLOCATED();
844 public: 859 public:
845 explicit AllowPaintInvalidationScope(FrameView* view) 860 explicit AllowPaintInvalidationScope(FrameView* view)
846 : m_view(view) 861 : m_view(view)
847 , m_originalValue(view ? view->canInvalidatePaintDuringPerformLayout() : false) 862 , m_originalValue(view ? view->canInvalidatePaintDuringPerformLayout() : false)
848 { 863 {
849 if (!m_view) 864 if (!m_view)
850 return; 865 return;
851 866
852 m_view->setCanInvalidatePaintDuringPerformLayout(true); 867 m_view->setCanInvalidatePaintDuringPerformLayout(true);
853 } 868 }
854 869
855 ~AllowPaintInvalidationScope() 870 ~AllowPaintInvalidationScope()
856 { 871 {
857 if (!m_view) 872 if (!m_view)
858 return; 873 return;
859 874
860 m_view->setCanInvalidatePaintDuringPerformLayout(m_originalValue); 875 m_view->setCanInvalidatePaintDuringPerformLayout(m_originalValue);
861 } 876 }
877
862 private: 878 private:
863 FrameView* m_view; 879 RawPtrWillBeMember<FrameView> m_view;
864 bool m_originalValue; 880 bool m_originalValue;
865 }; 881 };
866 882
867 } // namespace blink 883 } // namespace blink
868 884
869 #endif // FrameView_h 885 #endif // FrameView_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698