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

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: WebSockets + Tests. 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
« no previous file with comments | « Source/core/loader/FrameLoader.h ('k') | Source/modules/websockets/DOMWebSocket.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/FrameLoader.cpp
diff --git a/Source/core/loader/FrameLoader.cpp b/Source/core/loader/FrameLoader.cpp
index 64701ab3aa37ded93480739484ba1185ef8bd5a1..194e4009a959117ae998d57a32689ca5f5b8bbdc 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::InsecureContentDoNotUpgrade;
+
+ // FIXME: We need a way to propagate insecure content policy flags to
+ // out-of-process frames. For now, we'll always use default behavior.
+ if (!parentFrame->isLocalFrame())
+ return SecurityContext::InsecureContentDoNotUpgrade;
+
+ return toLocalFrame(parentFrame)->document()->insecureContentPolicy();
+}
+
} // namespace blink
« no previous file with comments | « Source/core/loader/FrameLoader.h ('k') | Source/modules/websockets/DOMWebSocket.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698