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

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

Issue 2415373002: Loading: bulk style errors fix in core/loader (Closed)
Patch Set: Created 4 years, 2 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/loader/MixedContentChecker.cpp
diff --git a/third_party/WebKit/Source/core/loader/MixedContentChecker.cpp b/third_party/WebKit/Source/core/loader/MixedContentChecker.cpp
index 903dfb39181b84106df8105ae688251709fab870..1f87e09738f604b3b8c8ee82b06f674b254964fc 100644
--- a/third_party/WebKit/Source/core/loader/MixedContentChecker.cpp
+++ b/third_party/WebKit/Source/core/loader/MixedContentChecker.cpp
@@ -54,9 +54,10 @@ namespace {
// function is used, for example, to determine the URL to show in console
// messages about mixed content.
KURL mainResourceUrlForFrame(Frame* frame) {
- if (frame->isRemoteFrame())
+ if (frame->isRemoteFrame()) {
return KURL(KURL(),
frame->securityContext()->getSecurityOrigin()->toString());
+ }
return toLocalFrame(frame)->document()->url();
}
@@ -70,10 +71,11 @@ static void measureStricterVersionOfIsMixedContent(Frame* frame,
// sure we're not breaking the world without realizing it.
SecurityOrigin* origin = frame->securityContext()->getSecurityOrigin();
if (MixedContentChecker::isMixedContent(origin, url)) {
- if (origin->protocol() != "https")
+ if (origin->protocol() != "https") {
UseCounter::count(
frame,
UseCounter::MixedContentInNonHTTPSFrameThatRestrictsMixedContent);
+ }
} else if (!SecurityOrigin::isSecure(url) &&
SchemeRegistry::shouldTreatURLSchemeAsSecure(origin->protocol())) {
UseCounter::count(
@@ -306,9 +308,10 @@ bool MixedContentChecker::shouldBlockFetch(
break;
};
- if (reportingStatus == SendReport)
+ if (reportingStatus == SendReport) {
logToConsoleAboutFetch(frame, mainResourceUrlForFrame(mixedFrame), url,
requestContext, allowed);
+ }
return !allowed;
}
@@ -345,9 +348,10 @@ bool MixedContentChecker::shouldBlockWebSocket(
UseCounter::count(mixedFrame, UseCounter::MixedContentPresent);
UseCounter::count(mixedFrame, UseCounter::MixedContentWebSocket);
if (ContentSecurityPolicy* policy =
- frame->securityContext()->contentSecurityPolicy())
+ frame->securityContext()->contentSecurityPolicy()) {
policy->reportMixedContent(url,
ResourceRequest::RedirectStatus::NoRedirect);
+ }
Settings* settings = mixedFrame->settings();
// Use the current local frame's client; the embedder doesn't distinguish
@@ -373,9 +377,10 @@ bool MixedContentChecker::shouldBlockWebSocket(
if (allowed)
client->didRunInsecureContent(securityOrigin, url);
- if (reportingStatus == SendReport)
+ if (reportingStatus == SendReport) {
logToConsoleAboutWebSocket(frame, mainResourceUrlForFrame(mixedFrame), url,
allowed);
+ }
return !allowed;
}
@@ -422,9 +427,10 @@ void MixedContentChecker::checkMixedPrivatePublic(
// Just count these for the moment, don't block them.
if (NetworkUtils::isReservedIPAddress(resourceIPAddress) &&
- frame->document()->addressSpace() == WebAddressSpacePublic)
+ frame->document()->addressSpace() == WebAddressSpacePublic) {
UseCounter::count(frame->document(),
UseCounter::MixedContentPrivateHostnameInPublicHostname);
+ }
}
Frame* MixedContentChecker::effectiveFrameForFrameType(

Powered by Google App Engine
This is Rietveld 408576698