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

Side by Side Diff: Source/core/svg/graphics/SVGImage.cpp

Issue 22999031: Assert that loading is complete in SVGImage::hasSingleSecurityOrigin() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006 Eric Seidel <eric@webkit.org> 2 * Copyright (C) 2006 Eric Seidel <eric@webkit.org>
3 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. 3 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved.
4 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 4 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 76
77 return page->chrome().client().isSVGImageChromeClient(); 77 return page->chrome().client().isSVGImageChromeClient();
78 } 78 }
79 79
80 bool SVGImage::hasSingleSecurityOrigin() const 80 bool SVGImage::hasSingleSecurityOrigin() const
81 { 81 {
82 if (!m_page) 82 if (!m_page)
83 return true; 83 return true;
84 84
85 Frame* frame = m_page->mainFrame(); 85 Frame* frame = m_page->mainFrame();
86
87 RELEASE_ASSERT(!frame->loader()->activeDocumentLoader()->isLoading());
abarth-chromium 2013/08/21 17:07:31 If you want to do things this way, the best check
88
86 SVGSVGElement* rootElement = toSVGDocument(frame->document())->rootElement() ; 89 SVGSVGElement* rootElement = toSVGDocument(frame->document())->rootElement() ;
87 if (!rootElement) 90 if (!rootElement)
88 return true; 91 return true;
89 92
90 // Don't allow foreignObject elements or images that are not known to be 93 // Don't allow foreignObject elements or images that are not known to be
91 // single-origin since these can leak cross-origin information. 94 // single-origin since these can leak cross-origin information.
92 ComposedShadowTreeWalker walker(rootElement); 95 ComposedShadowTreeWalker walker(rootElement);
93 while (Node* node = walker.get()) { 96 while (Node* node = walker.get()) {
94 if (node->hasTagName(SVGNames::foreignObjectTag)) 97 if (node->hasTagName(SVGNames::foreignObjectTag))
95 return false; 98 return false;
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 return m_page; 413 return m_page;
411 } 414 }
412 415
413 String SVGImage::filenameExtension() const 416 String SVGImage::filenameExtension() const
414 { 417 {
415 return "svg"; 418 return "svg";
416 } 419 }
417 420
418 } 421 }
419 422
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698