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

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
Index: Source/core/dom/DocumentInit.cpp
diff --git a/Source/core/dom/DocumentInit.cpp b/Source/core/dom/DocumentInit.cpp
index adf48c24b6932eab4b95cb7beeda5751a70223a3..016e9f082df5bc1548846e68dff4dedc817dd67e 100644
--- a/Source/core/dom/DocumentInit.cpp
+++ b/Source/core/dom/DocumentInit.cpp
@@ -43,18 +43,30 @@ bool DocumentInit::shouldTreatURLAsSrcdocDocument() const
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();
+ return frameForSecurityContext()->loader()->effectiveSandboxFlags();
Mike West 2013/07/22 14:39:42 It looks like this can now be null?
}
Settings* DocumentInit::settings() const
{
- return m_frame->settings();
+ return frameForSecurityContext()->settings();
Mike West 2013/07/22 14:39:42 Ditto.
}
Frame* DocumentInit::ownerFrame() const
{
+ if (!m_frame)
+ return 0;
+
Frame* ownerFrame = m_frame->tree()->parent();
if (!ownerFrame)
ownerFrame = m_frame->loader()->opener();

Powered by Google App Engine
This is Rietveld 408576698