| 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 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 // same page. | 371 // same page. |
| 372 FrameLoaderClient* client = frame->loader().client(); | 372 FrameLoaderClient* client = frame->loader().client(); |
| 373 bool strictMixedContentCheckingForPlugin = effectiveFrame->settings() && eff
ectiveFrame->settings()->strictMixedContentCheckingForPlugin(); | 373 bool strictMixedContentCheckingForPlugin = effectiveFrame->settings() && eff
ectiveFrame->settings()->strictMixedContentCheckingForPlugin(); |
| 374 WebMixedContent::ContextType contextType = WebMixedContent::contextTypeFromR
equestContext(requestContext, strictMixedContentCheckingForPlugin); | 374 WebMixedContent::ContextType contextType = WebMixedContent::contextTypeFromR
equestContext(requestContext, strictMixedContentCheckingForPlugin); |
| 375 if (contextType == WebMixedContent::ContextType::Blockable) { | 375 if (contextType == WebMixedContent::ContextType::Blockable) { |
| 376 client->didRunContentWithCertificateErrors(response.url()); | 376 client->didRunContentWithCertificateErrors(response.url()); |
| 377 } else { | 377 } else { |
| 378 // contextTypeFromRequestContext() never returns NotMixedContent (it | 378 // contextTypeFromRequestContext() never returns NotMixedContent (it |
| 379 // computes the type of mixed content, given that the content is | 379 // computes the type of mixed content, given that the content is |
| 380 // mixed). | 380 // mixed). |
| 381 DCHECK(contextType != WebMixedContent::ContextType::NotMixedContent); | 381 DCHECK_NE(contextType, WebMixedContent::ContextType::NotMixedContent); |
| 382 client->didDisplayContentWithCertificateErrors(response.url()); | 382 client->didDisplayContentWithCertificateErrors(response.url()); |
| 383 } | 383 } |
| 384 } | 384 } |
| 385 | 385 |
| 386 WebMixedContent::ContextType MixedContentChecker::contextTypeForInspector(LocalF
rame* frame, const ResourceRequest& request) | 386 WebMixedContent::ContextType MixedContentChecker::contextTypeForInspector(LocalF
rame* frame, const ResourceRequest& request) |
| 387 { | 387 { |
| 388 Frame* effectiveFrame = effectiveFrameForFrameType(frame, request.frameType(
)); | 388 Frame* effectiveFrame = effectiveFrameForFrameType(frame, request.frameType(
)); |
| 389 | 389 |
| 390 Frame* mixedFrame = inWhichFrameIsContentMixed(effectiveFrame, request.frame
Type(), request.url()); | 390 Frame* mixedFrame = inWhichFrameIsContentMixed(effectiveFrame, request.frame
Type(), request.url()); |
| 391 if (!mixedFrame) | 391 if (!mixedFrame) |
| 392 return WebMixedContent::ContextType::NotMixedContent; | 392 return WebMixedContent::ContextType::NotMixedContent; |
| 393 | 393 |
| 394 // See comment in shouldBlockFetch() about loading the main resource of a su
bframe. | 394 // See comment in shouldBlockFetch() about loading the main resource of a su
bframe. |
| 395 if (request.frameType() == WebURLRequest::FrameTypeNested && !SchemeRegistry
::shouldTreatURLSchemeAsCORSEnabled(request.url().protocol())) { | 395 if (request.frameType() == WebURLRequest::FrameTypeNested && !SchemeRegistry
::shouldTreatURLSchemeAsCORSEnabled(request.url().protocol())) { |
| 396 return WebMixedContent::ContextType::OptionallyBlockable; | 396 return WebMixedContent::ContextType::OptionallyBlockable; |
| 397 } | 397 } |
| 398 | 398 |
| 399 bool strictMixedContentCheckingForPlugin = mixedFrame->settings() && mixedFr
ame->settings()->strictMixedContentCheckingForPlugin(); | 399 bool strictMixedContentCheckingForPlugin = mixedFrame->settings() && mixedFr
ame->settings()->strictMixedContentCheckingForPlugin(); |
| 400 return WebMixedContent::contextTypeFromRequestContext(request.requestContext
(), strictMixedContentCheckingForPlugin); | 400 return WebMixedContent::contextTypeFromRequestContext(request.requestContext
(), strictMixedContentCheckingForPlugin); |
| 401 } | 401 } |
| 402 | 402 |
| 403 } // namespace blink | 403 } // namespace blink |
| OLD | NEW |