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

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGFEImageElement.cpp

Issue 1667843003: Make Resource RefCountedWillBeGarbageCollectedFinalized, attempt #2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix known issues 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) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
4 * Copyright (C) 2010 Dirk Schulze <krit@webkit.org> 4 * Copyright (C) 2010 Dirk Schulze <krit@webkit.org>
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 29 matching lines...) Expand all
40 addToPropertyMap(m_preserveAspectRatio); 40 addToPropertyMap(m_preserveAspectRatio);
41 } 41 }
42 42
43 DEFINE_NODE_FACTORY(SVGFEImageElement) 43 DEFINE_NODE_FACTORY(SVGFEImageElement)
44 44
45 SVGFEImageElement::~SVGFEImageElement() 45 SVGFEImageElement::~SVGFEImageElement()
46 { 46 {
47 #if ENABLE(OILPAN) 47 #if ENABLE(OILPAN)
48 if (m_cachedImage) { 48 if (m_cachedImage) {
49 m_cachedImage->removeClient(this); 49 m_cachedImage->removeClient(this);
50 m_cachedImage = 0; 50 m_cachedImage = nullptr;
51 } 51 }
52 #else 52 #else
53 clearResourceReferences(); 53 clearResourceReferences();
54 #endif 54 #endif
55 } 55 }
56 56
57 DEFINE_TRACE(SVGFEImageElement) 57 DEFINE_TRACE(SVGFEImageElement)
58 { 58 {
59 visitor->trace(m_preserveAspectRatio); 59 visitor->trace(m_preserveAspectRatio);
60 visitor->trace(m_cachedImage);
60 SVGFilterPrimitiveStandardAttributes::trace(visitor); 61 SVGFilterPrimitiveStandardAttributes::trace(visitor);
61 SVGURIReference::trace(visitor); 62 SVGURIReference::trace(visitor);
62 } 63 }
63 64
64 bool SVGFEImageElement::currentFrameHasSingleSecurityOrigin() const 65 bool SVGFEImageElement::currentFrameHasSingleSecurityOrigin() const
65 { 66 {
66 if (m_cachedImage && m_cachedImage->image()) 67 if (m_cachedImage && m_cachedImage->image())
67 return m_cachedImage->image()->currentFrameHasSingleSecurityOrigin(); 68 return m_cachedImage->image()->currentFrameHasSingleSecurityOrigin();
68 69
69 return true; 70 return true;
70 } 71 }
71 72
72 void SVGFEImageElement::clearResourceReferences() 73 void SVGFEImageElement::clearResourceReferences()
73 { 74 {
74 if (m_cachedImage) { 75 if (m_cachedImage) {
75 m_cachedImage->removeClient(this); 76 m_cachedImage->removeClient(this);
76 m_cachedImage = 0; 77 m_cachedImage = nullptr;
77 } 78 }
78 79
79 removeAllOutgoingReferences(); 80 removeAllOutgoingReferences();
80 } 81 }
81 82
82 void SVGFEImageElement::fetchImageResource() 83 void SVGFEImageElement::fetchImageResource()
83 { 84 {
84 FetchRequest request(ResourceRequest(ownerDocument()->completeURL(hrefString ())), localName()); 85 FetchRequest request(ResourceRequest(ownerDocument()->completeURL(hrefString ())), localName());
85 m_cachedImage = ImageResource::fetch(request, document().fetcher()); 86 m_cachedImage = ImageResource::fetch(request, document().fetcher());
86 87
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 // Don't use the broken image icon on image loading errors. 163 // Don't use the broken image icon on image loading errors.
163 RefPtr<Image> image = m_cachedImage->errorOccurred() ? 164 RefPtr<Image> image = m_cachedImage->errorOccurred() ?
164 nullptr : m_cachedImage->image(); 165 nullptr : m_cachedImage->image();
165 return FEImage::createWithImage(filter, image, m_preserveAspectRatio->cu rrentValue()); 166 return FEImage::createWithImage(filter, image, m_preserveAspectRatio->cu rrentValue());
166 } 167 }
167 168
168 return FEImage::createWithIRIReference(filter, treeScope(), hrefString(), m_ preserveAspectRatio->currentValue()); 169 return FEImage::createWithIRIReference(filter, treeScope(), hrefString(), m_ preserveAspectRatio->currentValue());
169 } 170 }
170 171
171 } // namespace blink 172 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698