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

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

Issue 948853002: Mixed Content: Make strict mode stricter. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Feedback 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 | « LayoutTests/http/tests/security/mixedContent/strict-mode-websocket-blocked.https.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/MixedContentChecker.cpp
diff --git a/Source/core/loader/MixedContentChecker.cpp b/Source/core/loader/MixedContentChecker.cpp
index 474422bebfca90d597a5a63562fab7846cd0cc0b..3d8e6e04409c910f964a80035b9fe222200410c8 100644
--- a/Source/core/loader/MixedContentChecker.cpp
+++ b/Source/core/loader/MixedContentChecker.cpp
@@ -329,8 +329,9 @@ bool MixedContentChecker::shouldBlockFetch(LocalFrame* frame, WebURLRequest::Req
break;
case ContextTypeShouldBeBlockable:
- allowed = true;
- client->didDisplayInsecureContent();
+ allowed = !strictMode;
+ if (allowed)
+ client->didDisplayInsecureContent();
break;
};
@@ -349,14 +350,14 @@ bool MixedContentChecker::shouldBlockConnection(LocalFrame* frame, const KURL& u
UseCounter::count(mixedFrame, UseCounter::MixedContentPresent);
UseCounter::count(mixedFrame, UseCounter::MixedContentWebSocket);
- // If we're in strict mode, we'll automagically fail everything, and intentionally skip
- // the client checks in order to prevent degrading the site's security UI.
- bool strictMode = mixedFrame->document()->shouldEnforceStrictMixedContentChecking();
-
Settings* settings = mixedFrame->settings();
FrameLoaderClient* client = mixedFrame->loader().client();
SecurityOrigin* securityOrigin = mixedFrame->document()->securityOrigin();
- bool allowedPerSettings = settings && (settings->allowRunningOfInsecureContent() || settings->allowConnectingInsecureWebSocket());
+
+ // If we're in strict mode, we'll automagically fail everything, and intentionally skip
+ // the client checks in order to prevent degrading the site's security UI.
+ bool strictMode = mixedFrame->document()->shouldEnforceStrictMixedContentChecking() || settings->strictMixedContentChecking();
+ bool allowedPerSettings = !strictMode && settings && (settings->allowRunningOfInsecureContent() || settings->allowConnectingInsecureWebSocket());
bool allowed = !strictMode && client->allowRunningInsecureContent(allowedPerSettings, securityOrigin, url);
if (reportingStatus == SendReport) {
« no previous file with comments | « LayoutTests/http/tests/security/mixedContent/strict-mode-websocket-blocked.https.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698