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

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

Issue 8038032: Merge 94905 - Source/WebCore: Crash due to bad data in SVGDocumentExtensions m_pendingResources (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/835/
Patch Set: Created 9 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/svg/SVGDocumentExtensions.h ('k') | Source/WebCore/svg/SVGStyledElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/svg/SVGDocumentExtensions.cpp
===================================================================
--- Source/WebCore/svg/SVGDocumentExtensions.cpp (revision 95993)
+++ Source/WebCore/svg/SVGDocumentExtensions.cpp (working copy)
@@ -227,7 +227,7 @@
m_pendingResources.add(id, set);
}
- element->setHasPendingResources(true);
+ element->setHasPendingResources();
}
bool SVGDocumentExtensions::hasPendingResources(const AtomicString& id) const
@@ -238,6 +238,24 @@
return m_pendingResources.contains(id);
}
+bool SVGDocumentExtensions::isElementInPendingResources(SVGStyledElement* element) const
+{
+ ASSERT(element);
+
+ if (m_pendingResources.isEmpty())
+ return false;
+
+ HashMap<AtomicString, SVGPendingElements*>::const_iterator end = m_pendingResources.end();
+ for (HashMap<AtomicString, SVGPendingElements*>::const_iterator it = m_pendingResources.begin(); it != end; ++it) {
+ SVGPendingElements* elements = it->second;
+ ASSERT(elements);
+
+ if (elements->contains(element))
+ return true;
+ }
+ return false;
+}
+
void SVGDocumentExtensions::removeElementFromPendingResources(SVGStyledElement* element)
{
ASSERT(element);
@@ -245,8 +263,6 @@
if (m_pendingResources.isEmpty() || !element->hasPendingResources())
return;
- element->setHasPendingResources(false);
-
Vector<AtomicString> toBeRemoved;
HashMap<AtomicString, SVGPendingElements*>::iterator end = m_pendingResources.end();
for (HashMap<AtomicString, SVGPendingElements*>::iterator it = m_pendingResources.begin(); it != end; ++it) {
@@ -259,6 +275,8 @@
toBeRemoved.append(it->first);
}
+ element->clearHasPendingResourcesIfPossible();
+
if (toBeRemoved.isEmpty())
return;
Property changes on: Source\WebCore\svg\SVGDocumentExtensions.cpp
___________________________________________________________________
Added: svn:executable
+ *
« no previous file with comments | « Source/WebCore/svg/SVGDocumentExtensions.h ('k') | Source/WebCore/svg/SVGStyledElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698