| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 #include "platform/weborigin/SecurityOrigin.h" | 42 #include "platform/weborigin/SecurityOrigin.h" |
| 43 #include "public/platform/Platform.h" | 43 #include "public/platform/Platform.h" |
| 44 #include "wtf/text/StringBuilder.h" | 44 #include "wtf/text/StringBuilder.h" |
| 45 | 45 |
| 46 namespace blink { | 46 namespace blink { |
| 47 | 47 |
| 48 static void measureStricterVersionOfIsMixedContent(LocalFrame* frame, const KURL
& url) | 48 static void measureStricterVersionOfIsMixedContent(LocalFrame* frame, const KURL
& url) |
| 49 { | 49 { |
| 50 // We're currently only checking for mixed content in `https://*` contexts. | 50 // We're currently only checking for mixed content in `https://*` contexts. |
| 51 // What about other "secure" contexts the SchemeRegistry knows about? We'll | 51 // What about other "secure" contexts the SchemeRegistry knows about? We'll |
| 52 // use this method to measure the occurance of non-webby mixed content to | 52 // use this method to measure the occurrence of non-webby mixed content to |
| 53 // make sure we're not breaking the world without realizing it. | 53 // make sure we're not breaking the world without realizing it. |
| 54 SecurityOrigin* origin = frame->document()->securityOrigin(); | 54 SecurityOrigin* origin = frame->document()->securityOrigin(); |
| 55 if (MixedContentChecker::isMixedContent(origin, url)) { | 55 if (MixedContentChecker::isMixedContent(origin, url)) { |
| 56 if (frame->document()->securityOrigin()->protocol() != "https") | 56 if (frame->document()->securityOrigin()->protocol() != "https") |
| 57 UseCounter::count(frame, UseCounter::MixedContentInNonHTTPSFrameThat
RestrictsMixedContent); | 57 UseCounter::count(frame, UseCounter::MixedContentInNonHTTPSFrameThat
RestrictsMixedContent); |
| 58 } else if (!SecurityOrigin::isSecure(url) && SchemeRegistry::shouldTreatURLS
chemeAsSecure(origin->protocol())) { | 58 } else if (!SecurityOrigin::isSecure(url) && SchemeRegistry::shouldTreatURLS
chemeAsSecure(origin->protocol())) { |
| 59 UseCounter::count(frame, UseCounter::MixedContentInSecureFrameThatDoesNo
tRestrictMixedContent); | 59 UseCounter::count(frame, UseCounter::MixedContentInSecureFrameThatDoesNo
tRestrictMixedContent); |
| 60 } | 60 } |
| 61 } | 61 } |
| 62 | 62 |
| (...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 | 468 |
| 469 // See comment in shouldBlockFetch() about loading the main resource of a su
bframe. | 469 // See comment in shouldBlockFetch() about loading the main resource of a su
bframe. |
| 470 if (request.frameType() == WebURLRequest::FrameTypeNested && !SchemeRegistry
::shouldTreatURLSchemeAsCORSEnabled(request.url().protocol())) { | 470 if (request.frameType() == WebURLRequest::FrameTypeNested && !SchemeRegistry
::shouldTreatURLSchemeAsCORSEnabled(request.url().protocol())) { |
| 471 return ContextTypeOptionallyBlockable; | 471 return ContextTypeOptionallyBlockable; |
| 472 } | 472 } |
| 473 | 473 |
| 474 return contextTypeFromContext(request.requestContext(), mixedFrame); | 474 return contextTypeFromContext(request.requestContext(), mixedFrame); |
| 475 } | 475 } |
| 476 | 476 |
| 477 } // namespace blink | 477 } // namespace blink |
| OLD | NEW |