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

Unified Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 2040133003: Replace SecurityContext::InsecureRequestsPolicy with WebInsecureRequestPolicy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@combine-uir-block
Patch Set: Created 4 years, 6 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: third_party/WebKit/Source/core/dom/Document.cpp
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index f9c5602a6102cf49caa7c325114d588192cee7eb..5db3b7a190fd4e640678046b18c614893985bc48 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -4902,9 +4902,7 @@ void Document::initSecurityContext(const DocumentInit& initializer)
// In the common case, create the security context from the currently
// loading URL with a fresh content security policy.
enforceSandboxFlags(initializer.getSandboxFlags());
- if (initializer.shouldEnforceStrictMixedContentChecking())
- enforceStrictMixedContentChecking();
- setInsecureRequestsPolicy(initializer.getInsecureRequestsPolicy());
+ enforceInsecureRequestPolicy(initializer.getInsecureRequestPolicy());
if (initializer.insecureNavigationsToUpgrade()) {
for (auto toUpgrade : *initializer.insecureNavigationsToUpgrade())
addInsecureNavigationUpgrade(toUpgrade);
@@ -5860,10 +5858,10 @@ WebTaskRunner* Document::timerTaskRunner() const
return Platform::current()->currentThread()->scheduler()->timerTaskRunner();
}
-void Document::enforceStrictMixedContentChecking()
+void Document::enforceInsecureRequestPolicy(WebInsecureRequestPolicy policy)
{
- securityContext().setShouldEnforceStrictMixedContentChecking(true);
- if (frame())
+ securityContext().setInsecureRequestPolicy(policy);
+ if (frame() && policy & kBlockAllMixedContent)
frame()->loader().client()->didEnforceStrictMixedContentChecking();
}

Powered by Google App Engine
This is Rietveld 408576698