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

Unified Diff: Source/core/loader/FrameLoader.cpp

Issue 303793003: Make mixed content checking and CSP aware of RemoteFrames (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Improved comments Created 6 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
Index: Source/core/loader/FrameLoader.cpp
diff --git a/Source/core/loader/FrameLoader.cpp b/Source/core/loader/FrameLoader.cpp
index 3cefb06953460726a3caafbfaa1f0fbe6a74b7ee..d2cfdc24a5fca4602b492ed4ec74e26b9b2c0263 100644
--- a/Source/core/loader/FrameLoader.cpp
+++ b/Source/core/loader/FrameLoader.cpp
@@ -1330,7 +1330,7 @@ bool FrameLoader::shouldInterruptLoadForXFrameOptions(const String& content, con
{
UseCounter::count(m_frame->domWindow()->document(), UseCounter::XFrameOptions);
- LocalFrame* topFrame = m_frame->tree().top();
+ Frame* topFrame = m_frame->tree().top();
if (m_frame == topFrame)
return false;
@@ -1340,10 +1340,11 @@ bool FrameLoader::shouldInterruptLoadForXFrameOptions(const String& content, con
case XFrameOptionsSameOrigin: {
UseCounter::count(m_frame->domWindow()->document(), UseCounter::XFrameOptionsSameOrigin);
RefPtr<SecurityOrigin> origin = SecurityOrigin::create(url);
- if (!origin->isSameSchemeHostPort(topFrame->document()->securityOrigin()))
+ // Out-of-process ancestors are always a different origin.
+ if (!topFrame->isLocalFrame() || !origin->isSameSchemeHostPort(toLocalFrame(topFrame)->document()->securityOrigin()))
return true;
- for (LocalFrame* frame = m_frame->tree().parent(); frame; frame = frame->tree().parent()) {
- if (!origin->isSameSchemeHostPort(frame->document()->securityOrigin())) {
+ for (Frame* frame = m_frame->tree().parent(); frame; frame = frame->tree().parent()) {
+ if (!frame->isLocalFrame() || !origin->isSameSchemeHostPort(toLocalFrame(frame)->document()->securityOrigin())) {
UseCounter::count(m_frame->domWindow()->document(), UseCounter::XFrameOptionsSameOriginWithBadAncestorChain);
break;
}
@@ -1438,8 +1439,10 @@ void FrameLoader::dispatchDidClearWindowObjectInMainWorld()
SandboxFlags FrameLoader::effectiveSandboxFlags() const
{
SandboxFlags flags = m_forcedSandboxFlags;
- if (LocalFrame* parentFrame = m_frame->tree().parent())
- flags |= parentFrame->document()->sandboxFlags();
+ // FIXME: We need a way to propagate sandbox flags to out-of-process frames.
+ Frame* parentFrame = m_frame->tree().parent();
+ if (parentFrame && parentFrame->isLocalFrame())
+ flags |= toLocalFrame(parentFrame)->document()->sandboxFlags();
if (FrameOwner* frameOwner = m_frame->ownerElement())
flags |= frameOwner->sandboxFlags();
return flags;
« Source/core/frame/csp/CSPDirectiveList.cpp ('K') | « Source/core/loader/DocumentLoader.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698