| 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 #include "public/platform/WebURLRequest.h" | 40 #include "public/platform/WebURLRequest.h" |
| 41 #include "wtf/text/WTFString.h" | 41 #include "wtf/text/WTFString.h" |
| 42 | 42 |
| 43 namespace blink { | 43 namespace blink { |
| 44 | 44 |
| 45 class Frame; | 45 class Frame; |
| 46 class LocalFrame; | 46 class LocalFrame; |
| 47 class KURL; | 47 class KURL; |
| 48 class ResourceResponse; | 48 class ResourceResponse; |
| 49 class SecurityOrigin; | 49 class SecurityOrigin; |
| 50 class SourceLocation; |
| 50 | 51 |
| 51 // Checks resource loads for mixed content. If PlzNavigate is enabled then this | 52 // Checks resource loads for mixed content. If PlzNavigate is enabled then this |
| 52 // class only checks for sub-resource loads while frame-level loads are | 53 // class only checks for sub-resource loads while frame-level loads are |
| 53 // delegated to the browser where they are checked by | 54 // delegated to the browser where they are checked by |
| 54 // MixedContentNavigationThrottle. Changes to this class might need to be | 55 // MixedContentNavigationThrottle. Changes to this class might need to be |
| 55 // reflected on its browser counterpart. | 56 // reflected on its browser counterpart. |
| 56 // | 57 // |
| 57 // Current mixed content W3C draft that drives this implementation: | 58 // Current mixed content W3C draft that drives this implementation: |
| 58 // https://w3c.github.io/webappsec-mixed-content/ | 59 // https://w3c.github.io/webappsec-mixed-content/ |
| 59 class CORE_EXPORT MixedContentChecker final { | 60 class CORE_EXPORT MixedContentChecker final { |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 const ResourceResponse&, | 107 const ResourceResponse&, |
| 107 WebURLRequest::FrameType, | 108 WebURLRequest::FrameType, |
| 108 WebURLRequest::RequestContext); | 109 WebURLRequest::RequestContext); |
| 109 | 110 |
| 110 // Receive information about mixed content found externally. | 111 // Receive information about mixed content found externally. |
| 111 static void mixedContentFound(LocalFrame*, | 112 static void mixedContentFound(LocalFrame*, |
| 112 const KURL& mainResourceUrl, | 113 const KURL& mainResourceUrl, |
| 113 const KURL& mixedContentUrl, | 114 const KURL& mixedContentUrl, |
| 114 WebURLRequest::RequestContext, | 115 WebURLRequest::RequestContext, |
| 115 bool wasAllowed, | 116 bool wasAllowed, |
| 116 bool hadRedirect); | 117 bool hadRedirect, |
| 118 std::unique_ptr<SourceLocation>); |
| 117 | 119 |
| 118 private: | 120 private: |
| 119 FRIEND_TEST_ALL_PREFIXES(MixedContentCheckerTest, HandleCertificateError); | 121 FRIEND_TEST_ALL_PREFIXES(MixedContentCheckerTest, HandleCertificateError); |
| 120 | 122 |
| 121 static Frame* inWhichFrameIsContentMixed(Frame*, | 123 static Frame* inWhichFrameIsContentMixed(Frame*, |
| 122 WebURLRequest::FrameType, | 124 WebURLRequest::FrameType, |
| 123 const KURL&); | 125 const KURL&); |
| 124 | 126 |
| 125 static void logToConsoleAboutFetch(LocalFrame*, | 127 static void logToConsoleAboutFetch(LocalFrame*, |
| 126 const KURL&, | 128 const KURL&, |
| 127 const KURL&, | 129 const KURL&, |
| 128 WebURLRequest::RequestContext, | 130 WebURLRequest::RequestContext, |
| 129 bool allowed); | 131 bool allowed, |
| 132 std::unique_ptr<SourceLocation>); |
| 130 static void logToConsoleAboutWebSocket(LocalFrame*, | 133 static void logToConsoleAboutWebSocket(LocalFrame*, |
| 131 const KURL&, | 134 const KURL&, |
| 132 const KURL&, | 135 const KURL&, |
| 133 bool allowed); | 136 bool allowed); |
| 134 static void count(Frame*, WebURLRequest::RequestContext); | 137 static void count(Frame*, WebURLRequest::RequestContext); |
| 135 }; | 138 }; |
| 136 | 139 |
| 137 } // namespace blink | 140 } // namespace blink |
| 138 | 141 |
| 139 #endif // MixedContentChecker_h | 142 #endif // MixedContentChecker_h |
| OLD | NEW |