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

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

Issue 1657883002: Fix leak PaintLayerReflectionInfo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
5 * 5 *
6 * Other contributors: 6 * Other contributors:
7 * Robert O'Callahan <roc+@cs.cmu.edu> 7 * Robert O'Callahan <roc+@cs.cmu.edu>
8 * David Baron <dbaron@fas.harvard.edu> 8 * David Baron <dbaron@fas.harvard.edu>
9 * Christian Biesinger <cbiesinger@web.de> 9 * Christian Biesinger <cbiesinger@web.de>
10 * Randall Jesup <rjesup@wgate.com> 10 * Randall Jesup <rjesup@wgate.com>
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 if (groupedMapping()) { 196 if (groupedMapping()) {
197 DisableCompositingQueryAsserts disabler; 197 DisableCompositingQueryAsserts disabler;
198 setGroupedMapping(0, InvalidateLayerAndRemoveFromMapping); 198 setGroupedMapping(0, InvalidateLayerAndRemoveFromMapping);
199 } 199 }
200 200
201 // Child layers will be deleted by their corresponding layout objects, so 201 // Child layers will be deleted by their corresponding layout objects, so
202 // we don't need to delete them ourselves. 202 // we don't need to delete them ourselves.
203 203
204 clearCompositedLayerMapping(true); 204 clearCompositedLayerMapping(true);
205 205
206 if (PaintLayerReflectionInfo* reflectionInfo = this->reflectionInfo())
207 reflectionInfo->destroy();
208
209 if (m_scrollableArea) 206 if (m_scrollableArea)
210 m_scrollableArea->dispose(); 207 m_scrollableArea->dispose();
211 } 208 }
212 209
213 String PaintLayer::debugName() const 210 String PaintLayer::debugName() const
214 { 211 {
215 if (isReflection()) 212 if (isReflection())
216 return layoutObject()->parent()->debugName() + " (reflection)"; 213 return layoutObject()->parent()->debugName() + " (reflection)";
217 return layoutObject()->debugName(); 214 return layoutObject()->debugName();
218 } 215 }
(...skipping 1193 matching lines...) Expand 10 before | Expand all | Expand 10 after
1412 updateSelfPaintingLayer(); 1409 updateSelfPaintingLayer();
1413 } 1410 }
1414 1411
1415 void PaintLayer::updateReflectionInfo(const ComputedStyle* oldStyle) 1412 void PaintLayer::updateReflectionInfo(const ComputedStyle* oldStyle)
1416 { 1413 {
1417 ASSERT(!oldStyle || !layoutObject()->style()->reflectionDataEquivalent(oldSt yle)); 1414 ASSERT(!oldStyle || !layoutObject()->style()->reflectionDataEquivalent(oldSt yle));
1418 if (layoutObject()->hasReflection()) { 1415 if (layoutObject()->hasReflection()) {
1419 ensureRareData().reflectionInfo = adoptPtr(new PaintLayerReflectionInfo( *layoutBox())); 1416 ensureRareData().reflectionInfo = adoptPtr(new PaintLayerReflectionInfo( *layoutBox()));
1420 m_rareData->reflectionInfo->updateAfterStyleChange(oldStyle); 1417 m_rareData->reflectionInfo->updateAfterStyleChange(oldStyle);
1421 } else if (m_rareData && m_rareData->reflectionInfo) { 1418 } else if (m_rareData && m_rareData->reflectionInfo) {
1422 m_rareData->reflectionInfo->destroy();
1423 m_rareData->reflectionInfo = nullptr; 1419 m_rareData->reflectionInfo = nullptr;
1424 } 1420 }
1425 } 1421 }
1426 1422
1427 void PaintLayer::updateStackingNode() 1423 void PaintLayer::updateStackingNode()
1428 { 1424 {
1429 ASSERT(!m_stackingNode); 1425 ASSERT(!m_stackingNode);
1430 if (requiresStackingNode()) 1426 if (requiresStackingNode())
1431 m_stackingNode = adoptPtr(new PaintLayerStackingNode(this)); 1427 m_stackingNode = adoptPtr(new PaintLayerStackingNode(this));
1432 else 1428 else
(...skipping 1357 matching lines...) Expand 10 before | Expand all | Expand 10 after
2790 2786
2791 void showLayerTree(const blink::LayoutObject* layoutObject) 2787 void showLayerTree(const blink::LayoutObject* layoutObject)
2792 { 2788 {
2793 if (!layoutObject) { 2789 if (!layoutObject) {
2794 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); 2790 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n");
2795 return; 2791 return;
2796 } 2792 }
2797 showLayerTree(layoutObject->enclosingLayer()); 2793 showLayerTree(layoutObject->enclosingLayer());
2798 } 2794 }
2799 #endif 2795 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/fetch/ImageResource.h ('k') | third_party/WebKit/Source/core/paint/PaintLayerReflectionInfo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698