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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 |
OLD | NEW |