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: Rebase + address review comments 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 28 matching lines...) Expand all
39 addToPropertyMap(m_preserveAspectRatio); 39 addToPropertyMap(m_preserveAspectRatio);
40 } 40 }
41 41
42 DEFINE_NODE_FACTORY(SVGFEImageElement) 42 DEFINE_NODE_FACTORY(SVGFEImageElement)
43 43
44 SVGFEImageElement::~SVGFEImageElement() 44 SVGFEImageElement::~SVGFEImageElement()
45 { 45 {
46 #if ENABLE(OILPAN) 46 #if ENABLE(OILPAN)
47 if (m_cachedImage) { 47 if (m_cachedImage) {
48 m_cachedImage->removeClient(this); 48 m_cachedImage->removeClient(this);
49 m_cachedImage = 0; 49 m_cachedImage = nullptr;
50 } 50 }
51 #else 51 #else
52 clearResourceReferences(); 52 clearResourceReferences();
53 #endif 53 #endif
54 } 54 }
55 55
56 DEFINE_TRACE(SVGFEImageElement) 56 DEFINE_TRACE(SVGFEImageElement)
57 { 57 {
58 visitor->trace(m_preserveAspectRatio); 58 visitor->trace(m_preserveAspectRatio);
59 visitor->trace(m_cachedImage);
59 SVGFilterPrimitiveStandardAttributes::trace(visitor); 60 SVGFilterPrimitiveStandardAttributes::trace(visitor);
60 SVGURIReference::trace(visitor); 61 SVGURIReference::trace(visitor);
61 } 62 }
62 63
63 bool SVGFEImageElement::currentFrameHasSingleSecurityOrigin() const 64 bool SVGFEImageElement::currentFrameHasSingleSecurityOrigin() const
64 { 65 {
65 if (m_cachedImage && m_cachedImage->image()) 66 if (m_cachedImage && m_cachedImage->image())
66 return m_cachedImage->image()->currentFrameHasSingleSecurityOrigin(); 67 return m_cachedImage->image()->currentFrameHasSingleSecurityOrigin();
67 68
68 return true; 69 return true;
69 } 70 }
70 71
71 void SVGFEImageElement::clearResourceReferences() 72 void SVGFEImageElement::clearResourceReferences()
72 { 73 {
73 if (m_cachedImage) { 74 if (m_cachedImage) {
74 m_cachedImage->removeClient(this); 75 m_cachedImage->removeClient(this);
75 m_cachedImage = 0; 76 m_cachedImage = nullptr;
76 } 77 }
77 78
78 removeAllOutgoingReferences(); 79 removeAllOutgoingReferences();
79 } 80 }
80 81
81 void SVGFEImageElement::fetchImageResource() 82 void SVGFEImageElement::fetchImageResource()
82 { 83 {
83 FetchRequest request(ResourceRequest(ownerDocument()->completeURL(hrefString ())), localName()); 84 FetchRequest request(ResourceRequest(ownerDocument()->completeURL(hrefString ())), localName());
84 m_cachedImage = ImageResource::fetch(request, document().fetcher()); 85 m_cachedImage = ImageResource::fetch(request, document().fetcher());
85 86
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 // Don't use the broken image icon on image loading errors. 162 // Don't use the broken image icon on image loading errors.
162 RefPtr<Image> image = m_cachedImage->errorOccurred() ? 163 RefPtr<Image> image = m_cachedImage->errorOccurred() ?
163 nullptr : m_cachedImage->image(); 164 nullptr : m_cachedImage->image();
164 return FEImage::createWithImage(filter, image, m_preserveAspectRatio->cu rrentValue()); 165 return FEImage::createWithImage(filter, image, m_preserveAspectRatio->cu rrentValue());
165 } 166 }
166 167
167 return FEImage::createWithIRIReference(filter, treeScope(), hrefString(), m_ preserveAspectRatio->currentValue()); 168 return FEImage::createWithIRIReference(filter, treeScope(), hrefString(), m_ preserveAspectRatio->currentValue());
168 } 169 }
169 170
170 } // namespace blink 171 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGFEImageElement.h ('k') | third_party/WebKit/Source/core/svg/SVGUseElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698