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

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

Issue 901903003: CSP: Adding the 'upgrade-insecure-requests' directive. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 10 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 64701ab3aa37ded93480739484ba1185ef8bd5a1..a97a0ac6c8b099a695d81ea2b6a802b381f78c1c 100644
--- a/Source/core/loader/FrameLoader.cpp
+++ b/Source/core/loader/FrameLoader.cpp
@@ -1402,4 +1402,18 @@ bool FrameLoader::shouldEnforceStrictMixedContentChecking() const
return toLocalFrame(parentFrame)->document()->shouldEnforceStrictMixedContentChecking();
}
+SecurityContext::InsecureContentPolicy FrameLoader::insecureContentPolicy() const
+{
+ Frame* parentFrame = m_frame->tree().parent();
+ if (!parentFrame)
+ return SecurityContext::InsecureContentIgnore;
+
+ // FIXME: We need a way to propagate insecure content policy flags to
+ // out-of-process frames. For now, we'll always upgrade.
+ if (!parentFrame->isLocalFrame())
+ return SecurityContext::InsecureContentUpgrade;
Yoav Weiss 2015/02/05 13:25:36 Why always upgrade? Isn't ignoring the safer optio
Mike West 2015/02/05 13:39:34 I suppose so. *shrug* I'll change it. :)
+
+ return toLocalFrame(parentFrame)->document()->insecureContentPolicy();
+}
+
} // namespace blink
« Source/core/frame/csp/ContentSecurityPolicy.cpp ('K') | « Source/core/loader/FrameLoader.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698