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

Unified Diff: third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp

Issue 2173873003: Cancel image loads if decoding failed (attempt #2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix UAF Created 4 years, 5 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
Index: third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
diff --git a/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp b/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
index a059f7fb086270ce9aae5dc9f28daca4693c67e8..6b987b7c96a3447ebc40f3fa0adaa77e96a3e18f 100644
--- a/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
+++ b/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
@@ -479,13 +479,13 @@ void SVGImage::updateUseCounters(Document& document) const
}
}
-bool SVGImage::dataChanged(bool allDataReceived)
+Image::SizeAvailability SVGImage::dataChanged(bool allDataReceived)
{
TRACE_EVENT0("blink", "SVGImage::dataChanged");
// Don't do anything if is an empty image.
if (!data()->size())
- return true;
+ return SizeAvailable;
if (allDataReceived) {
// SVGImage will fire events (and the default C++ handlers run) but doesn't
@@ -499,7 +499,7 @@ bool SVGImage::dataChanged(bool allDataReceived)
if (m_page) {
toLocalFrame(m_page->mainFrame())->loader().load(FrameLoadRequest(0, blankURL(), SubstituteData(data(), AtomicString("image/svg+xml"),
AtomicString("UTF-8"), KURL(), ForceSynchronousLoad)));
- return true;
+ return SizeAvailable;
}
Page::PageClients pageClients;
@@ -559,7 +559,7 @@ bool SVGImage::dataChanged(bool allDataReceived)
m_intrinsicSize = roundedIntSize(concreteObjectSize(FloatSize(LayoutReplaced::defaultWidth, LayoutReplaced::defaultHeight)));
}
- return m_page;
+ return m_page ? SizeAvailable : SizeUnavailable;
}
String SVGImage::filenameExtension() const

Powered by Google App Engine
This is Rietveld 408576698