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