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

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: Rebase after 3 spin off CLs landed. Created 3 years, 12 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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 } 212 }
213 213
214 // static 214 // static
215 bool MixedContentChecker::shouldBlockFetch( 215 bool MixedContentChecker::shouldBlockFetch(
216 LocalFrame* frame, 216 LocalFrame* frame,
217 WebURLRequest::RequestContext requestContext, 217 WebURLRequest::RequestContext requestContext,
218 WebURLRequest::FrameType frameType, 218 WebURLRequest::FrameType frameType,
219 ResourceRequest::RedirectStatus redirectStatus, 219 ResourceRequest::RedirectStatus redirectStatus,
220 const KURL& url, 220 const KURL& url,
221 MixedContentChecker::ReportingStatus reportingStatus) { 221 MixedContentChecker::ReportingStatus reportingStatus) {
222 // Frame-level loads are checked by the browser. No need to check them again
223 // here.
224 if (frame->settings()->browserSideNavigationEnabled() &&
225 frameType != WebURLRequest::FrameTypeNone) {
226 return false;
227 }
228
222 Frame* effectiveFrame = effectiveFrameForFrameType(frame, frameType); 229 Frame* effectiveFrame = effectiveFrameForFrameType(frame, frameType);
223 Frame* mixedFrame = 230 Frame* mixedFrame =
224 inWhichFrameIsContentMixed(effectiveFrame, frameType, url); 231 inWhichFrameIsContentMixed(effectiveFrame, frameType, url);
225 if (!mixedFrame) 232 if (!mixedFrame)
226 return false; 233 return false;
227 234
228 MixedContentChecker::count(mixedFrame, requestContext); 235 MixedContentChecker::count(mixedFrame, requestContext);
229 if (ContentSecurityPolicy* policy = 236 if (ContentSecurityPolicy* policy =
230 frame->securityContext()->contentSecurityPolicy()) 237 frame->securityContext()->contentSecurityPolicy())
231 policy->reportMixedContent(url, redirectStatus); 238 policy->reportMixedContent(url, redirectStatus);
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 } 515 }
509 516
510 bool strictMixedContentCheckingForPlugin = 517 bool strictMixedContentCheckingForPlugin =
511 mixedFrame->settings() && 518 mixedFrame->settings() &&
512 mixedFrame->settings()->strictMixedContentCheckingForPlugin(); 519 mixedFrame->settings()->strictMixedContentCheckingForPlugin();
513 return WebMixedContent::contextTypeFromRequestContext( 520 return WebMixedContent::contextTypeFromRequestContext(
514 request.requestContext(), strictMixedContentCheckingForPlugin); 521 request.requestContext(), strictMixedContentCheckingForPlugin);
515 } 522 }
516 523
517 } // namespace blink 524 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698