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

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

Issue 2888953004: Check that SVGImage is loaded in ImageNotifyFinished() (Closed)
Patch Set: Comments Created 3 years, 7 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 | « third_party/WebKit/Source/core/svg/graphics/SVGImage.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 07080c840278229a7e29a82ee6df1c69ff602606..2fc251f94586049ee78ff5c58c9a76e7a23845db 100644
--- a/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
+++ b/third_party/WebKit/Source/core/svg/graphics/SVGImage.cpp
@@ -121,13 +121,24 @@ bool SVGImage::IsInSVGImage(const Node* node) {
return page->GetChromeClient().IsSVGImageChromeClient();
}
+void SVGImage::CheckLoaded() const {
+ CHECK(page_);
+
+ LocalFrame* frame = ToLocalFrame(page_->MainFrame());
+
+ // Failures of this assertion might result in wrong origin tainting checks,
+ // because CurrentFrameHasSingleSecurityOrigin() assumes all subresources of
+ // the SVG are loaded and thus ready for origin checks.
+ CHECK(frame->GetDocument()->LoadEventFinished());
+}
+
bool SVGImage::CurrentFrameHasSingleSecurityOrigin() const {
if (!page_)
return true;
LocalFrame* frame = ToLocalFrame(page_->MainFrame());
- CHECK(frame->GetDocument()->LoadEventFinished());
+ CheckLoaded();
SVGSVGElement* root_element =
frame->GetDocument()->AccessSVGExtensions().rootElement();
« no previous file with comments | « third_party/WebKit/Source/core/svg/graphics/SVGImage.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698