Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 |
| OLD | NEW |