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

Unified Diff: Source/core/dom/DocumentInit.cpp

Issue 19940002: [HTML Import] Respect Content Security Policy Model (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix Mac build failure Created 7 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
« no previous file with comments | « Source/core/dom/DocumentInit.h ('k') | Source/core/html/HTMLImport.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/DocumentInit.cpp
diff --git a/Source/core/dom/DocumentInit.cpp b/Source/core/dom/DocumentInit.cpp
index adf48c24b6932eab4b95cb7beeda5751a70223a3..1888f8ce792c27174cd53f445a3076d502a343d0 100644
--- a/Source/core/dom/DocumentInit.cpp
+++ b/Source/core/dom/DocumentInit.cpp
@@ -40,21 +40,36 @@ bool DocumentInit::shouldSetURL() const
bool DocumentInit::shouldTreatURLAsSrcdocDocument() const
{
+ ASSERT(m_frame);
return m_frame->loader()->shouldTreatURLAsSrcdocDocument(m_url);
}
+Frame* DocumentInit::frameForSecurityContext() const
+{
+ if (m_frame)
+ return m_frame;
+ if (m_import)
+ return m_import->frame();
+ return 0;
+}
+
SandboxFlags DocumentInit::sandboxFlags() const
{
- return m_frame->loader()->effectiveSandboxFlags();
+ ASSERT(frameForSecurityContext());
+ return frameForSecurityContext()->loader()->effectiveSandboxFlags();
}
Settings* DocumentInit::settings() const
{
- return m_frame->settings();
+ ASSERT(frameForSecurityContext());
+ return frameForSecurityContext()->settings();
}
Frame* DocumentInit::ownerFrame() const
{
+ if (!m_frame)
+ return 0;
+
Frame* ownerFrame = m_frame->tree()->parent();
if (!ownerFrame)
ownerFrame = m_frame->loader()->opener();
« no previous file with comments | « Source/core/dom/DocumentInit.h ('k') | Source/core/html/HTMLImport.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698