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

Side by Side Diff: third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp

Issue 1477113003: [Oilpan] Move ScrollAnimators onto oilpan heap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
« no previous file with comments | « third_party/WebKit/Source/platform/scroll/ScrollableArea.h ('k') | no next file » | 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) 2010, Google Inc. All rights reserved. 2 * Copyright (c) 2010, Google Inc. All rights reserved.
3 * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved. 3 * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 static const int kPixelsPerLineStep = 40; 47 static const int kPixelsPerLineStep = 40;
48 static const float kMinFractionToStepWhenPaging = 0.875f; 48 static const float kMinFractionToStepWhenPaging = 0.875f;
49 49
50 namespace blink { 50 namespace blink {
51 51
52 struct SameSizeAsScrollableArea { 52 struct SameSizeAsScrollableArea {
53 virtual ~SameSizeAsScrollableArea(); 53 virtual ~SameSizeAsScrollableArea();
54 #if ENABLE(ASSERT) && ENABLE(OILPAN) 54 #if ENABLE(ASSERT) && ENABLE(OILPAN)
55 VerifyEagerFinalization verifyEager; 55 VerifyEagerFinalization verifyEager;
56 #endif 56 #endif
57 void* pointer; 57 OwnPtrWillBeMember<void*> pointer[2];
58 unsigned bitfields : 16; 58 unsigned bitfields : 16;
59 IntPoint origin; 59 IntPoint origin;
60 }; 60 };
61 61
62 static_assert(sizeof(ScrollableArea) == sizeof(SameSizeAsScrollableArea), "Scrol lableArea should stay small"); 62 static_assert(sizeof(ScrollableArea) == sizeof(SameSizeAsScrollableArea), "Scrol lableArea should stay small");
63 63
64 int ScrollableArea::pixelsPerLineStep() 64 int ScrollableArea::pixelsPerLineStep()
65 { 65 {
66 return kPixelsPerLineStep; 66 return kPixelsPerLineStep;
67 } 67 }
(...skipping 18 matching lines...) Expand all
86 , m_scrollCornerNeedsPaintInvalidation(false) 86 , m_scrollCornerNeedsPaintInvalidation(false)
87 { 87 {
88 } 88 }
89 89
90 ScrollableArea::~ScrollableArea() 90 ScrollableArea::~ScrollableArea()
91 { 91 {
92 } 92 }
93 93
94 void ScrollableArea::clearScrollAnimators() 94 void ScrollableArea::clearScrollAnimators()
95 { 95 {
96 m_animators.clear(); 96 #if OS(MACOSX) && ENABLE(OILPAN)
peria 2015/12/03 13:42:08 This clearing is added to make the probability to
haraken 2015/12/03 14:48:47 Add something to make the likelihood small sounds
97 if (m_scrollAnimator)
98 m_scrollAnimator->cleanup();
99 #endif
100 m_scrollAnimator.clear();
101 m_programmaticScrollAnimator.clear();
97 } 102 }
98 103
99 ScrollAnimatorBase* ScrollableArea::scrollAnimator() const 104 ScrollAnimatorBase* ScrollableArea::scrollAnimator() const
100 { 105 {
101 if (!m_animators) 106 if (!m_scrollAnimator)
102 m_animators = adoptPtr(new ScrollableAreaAnimators); 107 m_scrollAnimator = ScrollAnimatorBase::create(const_cast<ScrollableArea* >(this));
103 108
104 if (!m_animators->scrollAnimator) 109 return m_scrollAnimator.get();
105 m_animators->scrollAnimator = ScrollAnimatorBase::create(const_cast<Scro llableArea*>(this));
106
107 return m_animators->scrollAnimator.get();
108 } 110 }
109 111
110 ProgrammaticScrollAnimator* ScrollableArea::programmaticScrollAnimator() const 112 ProgrammaticScrollAnimator* ScrollableArea::programmaticScrollAnimator() const
111 { 113 {
112 if (!m_animators) 114 if (!m_programmaticScrollAnimator)
113 m_animators = adoptPtr(new ScrollableAreaAnimators); 115 m_programmaticScrollAnimator = ProgrammaticScrollAnimator::create(const_ cast<ScrollableArea*>(this));
114 116
115 if (!m_animators->programmaticScrollAnimator) 117 return m_programmaticScrollAnimator.get();
116 m_animators->programmaticScrollAnimator = ProgrammaticScrollAnimator::cr eate(const_cast<ScrollableArea*>(this));
117
118 return m_animators->programmaticScrollAnimator.get();
119 } 118 }
120 119
121 void ScrollableArea::setScrollOrigin(const IntPoint& origin) 120 void ScrollableArea::setScrollOrigin(const IntPoint& origin)
122 { 121 {
123 if (m_scrollOrigin != origin) { 122 if (m_scrollOrigin != origin) {
124 m_scrollOrigin = origin; 123 m_scrollOrigin = origin;
125 m_scrollOriginChanged = true; 124 m_scrollOriginChanged = true;
126 } 125 }
127 } 126 }
128 127
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 if (Scrollbar* verticalBar = verticalScrollbar()) 576 if (Scrollbar* verticalBar = verticalScrollbar())
578 verticalScrollbarWidth = !verticalBar->isOverlayScrollbar() ? verticalBa r->width() : 0; 577 verticalScrollbarWidth = !verticalBar->isOverlayScrollbar() ? verticalBa r->width() : 0;
579 if (Scrollbar* horizontalBar = horizontalScrollbar()) 578 if (Scrollbar* horizontalBar = horizontalScrollbar())
580 horizontalScrollbarHeight = !horizontalBar->isOverlayScrollbar() ? horiz ontalBar->height() : 0; 579 horizontalScrollbarHeight = !horizontalBar->isOverlayScrollbar() ? horiz ontalBar->height() : 0;
581 580
582 return IntSize(std::max(0, size.width() - verticalScrollbarWidth), 581 return IntSize(std::max(0, size.width() - verticalScrollbarWidth),
583 std::max(0, size.height() - horizontalScrollbarHeight)); 582 std::max(0, size.height() - horizontalScrollbarHeight));
584 583
585 } 584 }
586 585
586 DEFINE_TRACE(ScrollableArea)
587 {
588 visitor->trace(m_scrollAnimator);
589 visitor->trace(m_programmaticScrollAnimator);
590 }
591
587 } // namespace blink 592 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/scroll/ScrollableArea.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698