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

Side by Side Diff: third_party/WebKit/Source/core/loader/MixedContentChecker.cpp

Issue 1905033002: PlzNavigate: Move navigation-level mixed content checks to the browser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@console-security-message
Patch Set: Overall code cleanup to request reviewers to PTAL. Created 4 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 default: 175 default:
176 NOTREACHED(); 176 NOTREACHED();
177 return; 177 return;
178 } 178 }
179 UseCounter::count(frame, feature); 179 UseCounter::count(frame, feature);
180 } 180 }
181 181
182 // static 182 // static
183 bool MixedContentChecker::shouldBlockFetch(LocalFrame* frame, WebURLRequest::Req uestContext requestContext, WebURLRequest::FrameType frameType, ResourceRequest: :RedirectStatus redirectStatus, const KURL& url, MixedContentChecker::ReportingS tatus reportingStatus) 183 bool MixedContentChecker::shouldBlockFetch(LocalFrame* frame, WebURLRequest::Req uestContext requestContext, WebURLRequest::FrameType frameType, ResourceRequest: :RedirectStatus redirectStatus, const KURL& url, MixedContentChecker::ReportingS tatus reportingStatus)
184 { 184 {
185 // Frame-level loads are checked by the browser. No need to check them again here.
186 if (frameType != WebURLRequest::FrameTypeNone)
187 return false;
carlosk 2016/07/18 14:37:13 Can anyone confirm this is the correct filter for
188
185 Frame* effectiveFrame = effectiveFrameForFrameType(frame, frameType); 189 Frame* effectiveFrame = effectiveFrameForFrameType(frame, frameType);
186 Frame* mixedFrame = inWhichFrameIsContentMixed(effectiveFrame, frameType, ur l); 190 Frame* mixedFrame = inWhichFrameIsContentMixed(effectiveFrame, frameType, ur l);
187 if (!mixedFrame) 191 if (!mixedFrame)
188 return false; 192 return false;
189 193
190 MixedContentChecker::count(mixedFrame, requestContext); 194 MixedContentChecker::count(mixedFrame, requestContext);
191 if (ContentSecurityPolicy* policy = frame->securityContext()->contentSecurit yPolicy()) 195 if (ContentSecurityPolicy* policy = frame->securityContext()->contentSecurit yPolicy())
192 policy->reportMixedContent(url, redirectStatus); 196 policy->reportMixedContent(url, redirectStatus);
193 197
194 Settings* settings = mixedFrame->settings(); 198 Settings* settings = mixedFrame->settings();
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 // See comment in shouldBlockFetch() about loading the main resource of a su bframe. 396 // See comment in shouldBlockFetch() about loading the main resource of a su bframe.
393 if (request.frameType() == WebURLRequest::FrameTypeNested && !SchemeRegistry ::shouldTreatURLSchemeAsCORSEnabled(request.url().protocol())) { 397 if (request.frameType() == WebURLRequest::FrameTypeNested && !SchemeRegistry ::shouldTreatURLSchemeAsCORSEnabled(request.url().protocol())) {
394 return WebMixedContent::ContextType::OptionallyBlockable; 398 return WebMixedContent::ContextType::OptionallyBlockable;
395 } 399 }
396 400
397 bool strictMixedContentCheckingForPlugin = mixedFrame->settings() && mixedFr ame->settings()->strictMixedContentCheckingForPlugin(); 401 bool strictMixedContentCheckingForPlugin = mixedFrame->settings() && mixedFr ame->settings()->strictMixedContentCheckingForPlugin();
398 return WebMixedContent::contextTypeFromRequestContext(request.requestContext (), strictMixedContentCheckingForPlugin); 402 return WebMixedContent::contextTypeFromRequestContext(request.requestContext (), strictMixedContentCheckingForPlugin);
399 } 403 }
400 404
401 } // namespace blink 405 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698