| 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 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 #include "base/gtest_prod_util.h" | 34 #include "base/gtest_prod_util.h" |
| 35 #include "core/CoreExport.h" | 35 #include "core/CoreExport.h" |
| 36 #include "platform/heap/Handle.h" | 36 #include "platform/heap/Handle.h" |
| 37 #include "platform/network/ResourceRequest.h" | 37 #include "platform/network/ResourceRequest.h" |
| 38 #include "public/platform/WebURLRequest.h" | 38 #include "public/platform/WebURLRequest.h" |
| 39 #include "wtf/text/WTFString.h" | 39 #include "wtf/text/WTFString.h" |
| 40 | 40 |
| 41 namespace blink { | 41 namespace blink { |
| 42 | 42 |
| 43 class Frame; |
| 43 class FrameLoaderClient; | 44 class FrameLoaderClient; |
| 44 class LocalFrame; | 45 class LocalFrame; |
| 45 class KURL; | 46 class KURL; |
| 46 class ResourceResponse; | 47 class ResourceResponse; |
| 47 class SecurityOrigin; | 48 class SecurityOrigin; |
| 48 | 49 |
| 49 class CORE_EXPORT MixedContentChecker final { | 50 class CORE_EXPORT MixedContentChecker final { |
| 50 WTF_MAKE_NONCOPYABLE(MixedContentChecker); | 51 WTF_MAKE_NONCOPYABLE(MixedContentChecker); |
| 51 DISALLOW_NEW(); | 52 DISALLOW_NEW(); |
| 52 public: | 53 public: |
| (...skipping 15 matching lines...) Expand all Loading... |
| 68 | 69 |
| 69 static bool isMixedContent(SecurityOrigin*, const KURL&); | 70 static bool isMixedContent(SecurityOrigin*, const KURL&); |
| 70 static bool isMixedFormAction(LocalFrame*, const KURL&, ReportingStatus = Se
ndReport); | 71 static bool isMixedFormAction(LocalFrame*, const KURL&, ReportingStatus = Se
ndReport); |
| 71 | 72 |
| 72 static void checkMixedPrivatePublic(LocalFrame*, const AtomicString& resourc
eIPAddress); | 73 static void checkMixedPrivatePublic(LocalFrame*, const AtomicString& resourc
eIPAddress); |
| 73 | 74 |
| 74 static ContextType contextTypeForInspector(LocalFrame*, const ResourceReques
t&); | 75 static ContextType contextTypeForInspector(LocalFrame*, const ResourceReques
t&); |
| 75 | 76 |
| 76 // Returns the frame that should be considered the effective frame | 77 // Returns the frame that should be considered the effective frame |
| 77 // for a mixed content check for the given frame type. | 78 // for a mixed content check for the given frame type. |
| 78 static LocalFrame* effectiveFrameForFrameType(LocalFrame*, WebURLRequest::Fr
ameType); | 79 static Frame* effectiveFrameForFrameType(LocalFrame*, WebURLRequest::FrameTy
pe); |
| 79 | 80 |
| 80 static void handleCertificateError(LocalFrame*, const ResourceRequest&, cons
t ResourceResponse&); | 81 static void handleCertificateError(LocalFrame*, const ResourceRequest&, cons
t ResourceResponse&); |
| 81 | 82 |
| 82 private: | 83 private: |
| 83 FRIEND_TEST_ALL_PREFIXES(MixedContentCheckerTest, HandleCertificateError); | 84 FRIEND_TEST_ALL_PREFIXES(MixedContentCheckerTest, HandleCertificateError); |
| 84 enum MixedContentType { | 85 enum MixedContentType { |
| 85 Display, | 86 Display, |
| 86 Execution, | 87 Execution, |
| 87 WebSocket, | 88 WebSocket, |
| 88 Submission | 89 Submission |
| 89 }; | 90 }; |
| 90 | 91 |
| 91 static LocalFrame* inWhichFrameIsContentMixed(LocalFrame*, WebURLRequest::Fr
ameType, const KURL&); | 92 static Frame* inWhichFrameIsContentMixed(Frame*, WebURLRequest::FrameType, c
onst KURL&); |
| 92 | 93 |
| 93 static ContextType contextTypeFromContext(WebURLRequest::RequestContext, Loc
alFrame*); | 94 static ContextType contextTypeFromContext(WebURLRequest::RequestContext, Fra
me*); |
| 94 static const char* typeNameFromContext(WebURLRequest::RequestContext); | 95 static const char* typeNameFromContext(WebURLRequest::RequestContext); |
| 95 static void logToConsoleAboutFetch(LocalFrame*, const KURL&, WebURLRequest::
RequestContext, bool allowed); | 96 static void logToConsoleAboutFetch(LocalFrame*, const KURL&, const KURL&, We
bURLRequest::RequestContext, bool allowed); |
| 96 static void logToConsoleAboutWebSocket(LocalFrame*, const KURL&, bool allowe
d); | 97 static void logToConsoleAboutWebSocket(LocalFrame*, const KURL&, const KURL&
, bool allowed); |
| 97 static void count(LocalFrame*, WebURLRequest::RequestContext); | 98 static void count(Frame*, WebURLRequest::RequestContext); |
| 98 }; | 99 }; |
| 99 | 100 |
| 100 } // namespace blink | 101 } // namespace blink |
| 101 | 102 |
| 102 #endif // MixedContentChecker_h | 103 #endif // MixedContentChecker_h |
| OLD | NEW |