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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp

Issue 2433873003: Fix crash when calling ScrollAnchor::clear from PaintLayer's destructor (Closed)
Patch Set: Created 4 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
« no previous file with comments | « third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp ('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) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * 4 *
5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
6 * 6 *
7 * Other contributors: 7 * Other contributors:
8 * Robert O'Callahan <roc+@cs.cmu.edu> 8 * Robert O'Callahan <roc+@cs.cmu.edu>
9 * David Baron <dbaron@fas.harvard.edu> 9 * David Baron <dbaron@fas.harvard.edu>
10 * Christian Biesinger <cbiesinger@gmail.com> 10 * Christian Biesinger <cbiesinger@gmail.com>
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 m_resizer->destroy(); 170 m_resizer->destroy();
171 171
172 clearScrollAnimators(); 172 clearScrollAnimators();
173 173
174 // Note: it is not safe to call ScrollAnchor::clear if the document is being 174 // Note: it is not safe to call ScrollAnchor::clear if the document is being
175 // destroyed, because LayoutObjectChildList::removeChildNode skips the call to 175 // destroyed, because LayoutObjectChildList::removeChildNode skips the call to
176 // willBeRemovedFromTree, 176 // willBeRemovedFromTree,
177 // leaving the ScrollAnchor with a stale LayoutObject pointer. 177 // leaving the ScrollAnchor with a stale LayoutObject pointer.
178 if (RuntimeEnabledFeatures::scrollAnchoringEnabled() && 178 if (RuntimeEnabledFeatures::scrollAnchoringEnabled() &&
179 !box().documentBeingDestroyed()) 179 !box().documentBeingDestroyed())
180 m_scrollAnchor.clear(); 180 m_scrollAnchor.clearSelf();
181 181
182 #if ENABLE(ASSERT) 182 #if ENABLE(ASSERT)
183 m_hasBeenDisposed = true; 183 m_hasBeenDisposed = true;
184 #endif 184 #endif
185 } 185 }
186 186
187 DEFINE_TRACE(PaintLayerScrollableArea) { 187 DEFINE_TRACE(PaintLayerScrollableArea) {
188 visitor->trace(m_scrollbarManager); 188 visitor->trace(m_scrollbarManager);
189 visitor->trace(m_scrollAnchor); 189 visitor->trace(m_scrollAnchor);
190 ScrollableArea::trace(visitor); 190 ScrollableArea::trace(visitor);
(...skipping 1788 matching lines...) Expand 10 before | Expand all | Expand 10 after
1979 1979
1980 void PaintLayerScrollableArea::DelayScrollOffsetClampScope:: 1980 void PaintLayerScrollableArea::DelayScrollOffsetClampScope::
1981 clampScrollableAreas() { 1981 clampScrollableAreas() {
1982 for (auto& scrollableArea : *s_needsClamp) 1982 for (auto& scrollableArea : *s_needsClamp)
1983 scrollableArea->clampScrollOffsetsAfterLayout(); 1983 scrollableArea->clampScrollOffsetsAfterLayout();
1984 delete s_needsClamp; 1984 delete s_needsClamp;
1985 s_needsClamp = nullptr; 1985 s_needsClamp = nullptr;
1986 } 1986 }
1987 1987
1988 } // namespace blink 1988 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698