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 // Tests that all main resource loads (frame navigations) always send a repo
rt. |
| 186 DCHECK(frameType == WebURLRequest::FrameTypeNone || reportingStatus == SendR
eport); |
| 187 |
185 Frame* effectiveFrame = effectiveFrameForFrameType(frame, frameType); | 188 Frame* effectiveFrame = effectiveFrameForFrameType(frame, frameType); |
186 Frame* mixedFrame = inWhichFrameIsContentMixed(effectiveFrame, frameType, ur
l); | 189 Frame* mixedFrame = inWhichFrameIsContentMixed(effectiveFrame, frameType, ur
l); |
187 if (!mixedFrame) | 190 if (!mixedFrame) |
188 return false; | 191 return false; |
189 | 192 |
190 MixedContentChecker::count(mixedFrame, requestContext); | 193 MixedContentChecker::count(mixedFrame, requestContext); |
191 if (ContentSecurityPolicy* policy = frame->securityContext()->contentSecurit
yPolicy()) | 194 if (ContentSecurityPolicy* policy = frame->securityContext()->contentSecurit
yPolicy()) |
192 policy->reportMixedContent(url, redirectStatus); | 195 policy->reportMixedContent(url, redirectStatus); |
193 | 196 |
194 Settings* settings = mixedFrame->settings(); | 197 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. | 395 // See comment in shouldBlockFetch() about loading the main resource of a su
bframe. |
393 if (request.frameType() == WebURLRequest::FrameTypeNested && !SchemeRegistry
::shouldTreatURLSchemeAsCORSEnabled(request.url().protocol())) { | 396 if (request.frameType() == WebURLRequest::FrameTypeNested && !SchemeRegistry
::shouldTreatURLSchemeAsCORSEnabled(request.url().protocol())) { |
394 return WebMixedContent::ContextType::OptionallyBlockable; | 397 return WebMixedContent::ContextType::OptionallyBlockable; |
395 } | 398 } |
396 | 399 |
397 bool strictMixedContentCheckingForPlugin = mixedFrame->settings() && mixedFr
ame->settings()->strictMixedContentCheckingForPlugin(); | 400 bool strictMixedContentCheckingForPlugin = mixedFrame->settings() && mixedFr
ame->settings()->strictMixedContentCheckingForPlugin(); |
398 return WebMixedContent::contextTypeFromRequestContext(request.requestContext
(), strictMixedContentCheckingForPlugin); | 401 return WebMixedContent::contextTypeFromRequestContext(request.requestContext
(), strictMixedContentCheckingForPlugin); |
399 } | 402 } |
400 | 403 |
401 } // namespace blink | 404 } // namespace blink |
OLD | NEW |