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

Unified Diff: Source/WebCore/svg/SVGUseElement.cpp

Issue 11564028: Merge 136541 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1312/
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/svg/SVGUseElement.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/svg/SVGUseElement.cpp
===================================================================
--- Source/WebCore/svg/SVGUseElement.cpp (revision 137693)
+++ Source/WebCore/svg/SVGUseElement.cpp (working copy)
@@ -107,8 +107,7 @@
SVGUseElement::~SVGUseElement()
{
- if (m_cachedDocument)
- m_cachedDocument->removeClient(this);
+ setCachedDocument(0);
clearResourceReferences();
}
@@ -256,18 +255,14 @@
KURL url = document()->completeURL(href());
if (url.hasFragmentIdentifier()) {
CachedResourceRequest request(ResourceRequest(url.string()));
- m_cachedDocument = document()->cachedResourceLoader()->requestSVGDocument(request);
- if (m_cachedDocument)
- m_cachedDocument->addClient(this);
+ setCachedDocument(document()->cachedResourceLoader()->requestSVGDocument(request));
}
- }
+ } else
+ setCachedDocument(0);
- if (m_cachedDocument && !isExternalReference) {
- m_cachedDocument->removeClient(this);
- m_cachedDocument = 0;
- }
if (!m_wasInsertedByParser)
buildPendingResource();
+
return;
}
@@ -991,6 +986,19 @@
}
}
+void SVGUseElement::setCachedDocument(CachedResourceHandle<CachedSVGDocument> cachedDocument)
+{
+ if (m_cachedDocument == cachedDocument)
+ return;
+
+ if (m_cachedDocument)
+ m_cachedDocument->removeClient(this);
+
+ m_cachedDocument = cachedDocument;
+ if (m_cachedDocument)
+ m_cachedDocument->addClient(this);
}
+}
+
#endif // ENABLE(SVG)
« no previous file with comments | « Source/WebCore/svg/SVGUseElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698