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

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

Issue 1265953002: Appease jschuh@ by adding a setting to move 'plugin' to blockable mixed content. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 5 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/MixedContentChecker.h ('k') | Source/web/WebSettingsImpl.h » ('j') | 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 c130d131a6d0f55791e34edf1feee5309d827fa1..449058f80cec9b82bb8e0a250f6ee313b3b95c8c 100644
--- a/Source/core/loader/MixedContentChecker.cpp
+++ b/Source/core/loader/MixedContentChecker.cpp
@@ -99,17 +99,22 @@ LocalFrame* MixedContentChecker::inWhichFrameIsContentMixed(LocalFrame* frame, W
}
// static
-MixedContentChecker::ContextType MixedContentChecker::contextTypeFromContext(WebURLRequest::RequestContext context)
+MixedContentChecker::ContextType MixedContentChecker::contextTypeFromContext(WebURLRequest::RequestContext context, LocalFrame* frame)
{
switch (context) {
// "Optionally-blockable" mixed content
case WebURLRequest::RequestContextAudio:
case WebURLRequest::RequestContextFavicon:
case WebURLRequest::RequestContextImage:
- case WebURLRequest::RequestContextPlugin:
case WebURLRequest::RequestContextVideo:
return ContextTypeOptionallyBlockable;
+ // Plugins! Oh how dearly we love plugin-loaded content!
+ case WebURLRequest::RequestContextPlugin: {
+ Settings* settings = frame->settings();
+ return settings || settings->strictMixedContentCheckingForPlugin() ? ContextTypeBlockable : ContextTypeOptionallyBlockable;
+ }
+
// "Blockable" mixed content
case WebURLRequest::RequestContextBeacon:
case WebURLRequest::RequestContextCSPReport:
@@ -246,7 +251,7 @@ void MixedContentChecker::count(LocalFrame* frame, WebURLRequest::RequestContext
// Roll blockable content up into a single counter, count unblocked types individually so we
// can determine when they can be safely moved to the blockable category:
- ContextType contextType = contextTypeFromContext(requestContext);
+ ContextType contextType = contextTypeFromContext(requestContext, frame);
if (contextType == ContextTypeBlockable) {
UseCounter::count(frame, UseCounter::MixedContentBlockable);
return;
@@ -304,7 +309,7 @@ bool MixedContentChecker::shouldBlockFetch(LocalFrame* frame, WebURLRequest::Req
// the client checks in order to prevent degrading the site's security UI.
bool strictMode = mixedFrame->document()->shouldEnforceStrictMixedContentChecking() || settings->strictMixedContentChecking();
- ContextType contextType = contextTypeFromContext(requestContext);
+ ContextType contextType = contextTypeFromContext(requestContext, mixedFrame);
// If we're loading the main resource of a subframe, we need to take a close look at the loaded URL.
// If we're dealing with a CORS-enabled scheme, then block mixed frames as active content. Otherwise,
« no previous file with comments | « Source/core/loader/MixedContentChecker.h ('k') | Source/web/WebSettingsImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698