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 19 matching lines...) Expand all Loading... |
30 | 30 |
31 #ifndef MixedContentChecker_h | 31 #ifndef MixedContentChecker_h |
32 #define MixedContentChecker_h | 32 #define MixedContentChecker_h |
33 | 33 |
34 #include "public/platform/WebURLRequest.h" | 34 #include "public/platform/WebURLRequest.h" |
35 #include "wtf/text/WTFString.h" | 35 #include "wtf/text/WTFString.h" |
36 | 36 |
37 namespace blink { | 37 namespace blink { |
38 | 38 |
39 class LocalFrame; | 39 class LocalFrame; |
40 class FrameLoaderClient; | |
41 class KURL; | 40 class KURL; |
42 class SecurityOrigin; | 41 class SecurityOrigin; |
43 class ResourceRequest; | |
44 | 42 |
45 class MixedContentChecker { | 43 class MixedContentChecker { |
46 WTF_MAKE_NONCOPYABLE(MixedContentChecker); | 44 WTF_MAKE_NONCOPYABLE(MixedContentChecker); |
47 public: | 45 public: |
48 static bool shouldBlockFetch(LocalFrame*, WebURLRequest::RequestContext, Web
URLRequest::FrameType, const KURL&); | 46 static bool shouldBlockFetch(LocalFrame*, WebURLRequest::RequestContext, Web
URLRequest::FrameType, const KURL&); |
49 static bool shouldBlockWebSocket(LocalFrame*, const KURL&); | 47 static bool shouldBlockWebSocket(LocalFrame*, const KURL&); |
50 static bool checkFormAction(LocalFrame*, const KURL&); | 48 static bool checkFormAction(LocalFrame*, const KURL&); |
51 static bool isMixedContent(SecurityOrigin*, const KURL&); | 49 static bool isMixedContent(SecurityOrigin*, const KURL&); |
52 | 50 |
53 private: | 51 private: |
54 enum ContextType { | 52 enum ContextType { |
55 ContextTypeBlockable, | 53 ContextTypeBlockable, |
56 ContextTypeOptionallyBlockable, | 54 ContextTypeOptionallyBlockable, |
57 ContextTypeShouldBeBlockable, | 55 ContextTypeShouldBeBlockable, |
58 ContextTypeBlockableUnlessLax | 56 ContextTypeBlockableUnlessLax |
59 }; | 57 }; |
60 | 58 |
61 static LocalFrame* inWhichFrameIsThisContentMixed(LocalFrame*, WebURLRequest
::RequestContext, WebURLRequest::FrameType, const KURL&); | 59 static LocalFrame* inWhichFrameIsThisContentMixed(LocalFrame*, WebURLRequest
::RequestContext, WebURLRequest::FrameType, const KURL&); |
62 static ContextType contextTypeFromContext(WebURLRequest::RequestContext); | 60 static ContextType contextTypeFromContext(WebURLRequest::RequestContext); |
63 static const char* typeNameFromContext(WebURLRequest::RequestContext); | 61 static const char* typeNameFromContext(WebURLRequest::RequestContext); |
64 static void logToConsole(LocalFrame*, const KURL&, WebURLRequest::RequestCon
text, bool allowed); | 62 static void logToConsole(LocalFrame*, const KURL&, WebURLRequest::RequestCon
text, bool allowed); |
65 }; | 63 }; |
66 | 64 |
67 } // namespace blink | 65 } // namespace blink |
68 | 66 |
69 #endif // MixedContentChecker_h | 67 #endif // MixedContentChecker_h |
OLD | NEW |