OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google, Inc. All rights reserved. | 2 * Copyright (C) 2011 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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 24 matching lines...) Expand all Loading... |
35 #include "platform/loader/fetch/Resource.h" | 35 #include "platform/loader/fetch/Resource.h" |
36 #include "platform/network/ContentSecurityPolicyParsers.h" | 36 #include "platform/network/ContentSecurityPolicyParsers.h" |
37 #include "platform/network/HTTPParsers.h" | 37 #include "platform/network/HTTPParsers.h" |
38 #include "platform/network/ResourceRequest.h" | 38 #include "platform/network/ResourceRequest.h" |
39 #include "public/platform/WebInsecureRequestPolicy.h" | 39 #include "public/platform/WebInsecureRequestPolicy.h" |
40 #include "wtf/HashSet.h" | 40 #include "wtf/HashSet.h" |
41 #include "wtf/Vector.h" | 41 #include "wtf/Vector.h" |
42 #include "wtf/text/StringHash.h" | 42 #include "wtf/text/StringHash.h" |
43 #include "wtf/text/TextPosition.h" | 43 #include "wtf/text/TextPosition.h" |
44 #include "wtf/text/WTFString.h" | 44 #include "wtf/text/WTFString.h" |
| 45 |
45 #include <memory> | 46 #include <memory> |
46 #include <utility> | 47 #include <utility> |
47 | 48 |
48 namespace WTF { | 49 namespace WTF { |
49 class OrdinalNumber; | 50 class OrdinalNumber; |
50 } | 51 } |
51 | 52 |
52 namespace blink { | 53 namespace blink { |
53 | 54 |
54 class ContentSecurityPolicyResponseHeaders; | 55 class ContentSecurityPolicyResponseHeaders; |
55 class ConsoleMessage; | 56 class ConsoleMessage; |
56 class CSPDirectiveList; | 57 class CSPDirectiveList; |
57 class CSPSource; | 58 class CSPSource; |
58 class Document; | 59 class Document; |
59 class Element; | 60 class Element; |
60 class FrameLoaderClient; | 61 class LocalFrameClient; |
61 class KURL; | 62 class KURL; |
62 class ResourceRequest; | 63 class ResourceRequest; |
63 class SecurityOrigin; | 64 class SecurityOrigin; |
64 class SecurityPolicyViolationEventInit; | 65 class SecurityPolicyViolationEventInit; |
65 | 66 |
66 typedef int SandboxFlags; | 67 typedef int SandboxFlags; |
67 typedef HeapVector<Member<CSPDirectiveList>> CSPDirectiveListVector; | 68 typedef HeapVector<Member<CSPDirectiveList>> CSPDirectiveListVector; |
68 typedef HeapVector<Member<ConsoleMessage>> ConsoleMessageVector; | 69 typedef HeapVector<Member<ConsoleMessage>> ConsoleMessageVector; |
69 typedef std::pair<String, ContentSecurityPolicyHeaderType> CSPHeaderAndType; | 70 typedef std::pair<String, ContentSecurityPolicyHeaderType> CSPHeaderAndType; |
70 using RedirectStatus = ResourceRequest::RedirectStatus; | 71 using RedirectStatus = ResourceRequest::RedirectStatus; |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 void copyStateFrom(const ContentSecurityPolicy*); | 120 void copyStateFrom(const ContentSecurityPolicy*); |
120 void copyPluginTypesFrom(const ContentSecurityPolicy*); | 121 void copyPluginTypesFrom(const ContentSecurityPolicy*); |
121 | 122 |
122 void didReceiveHeaders(const ContentSecurityPolicyResponseHeaders&); | 123 void didReceiveHeaders(const ContentSecurityPolicyResponseHeaders&); |
123 void didReceiveHeader(const String&, | 124 void didReceiveHeader(const String&, |
124 ContentSecurityPolicyHeaderType, | 125 ContentSecurityPolicyHeaderType, |
125 ContentSecurityPolicyHeaderSource); | 126 ContentSecurityPolicyHeaderSource); |
126 void addPolicyFromHeaderValue(const String&, | 127 void addPolicyFromHeaderValue(const String&, |
127 ContentSecurityPolicyHeaderType, | 128 ContentSecurityPolicyHeaderType, |
128 ContentSecurityPolicyHeaderSource); | 129 ContentSecurityPolicyHeaderSource); |
129 void reportAccumulatedHeaders(FrameLoaderClient*) const; | 130 void reportAccumulatedHeaders(LocalFrameClient*) const; |
130 | 131 |
131 std::unique_ptr<Vector<CSPHeaderAndType>> headers() const; | 132 std::unique_ptr<Vector<CSPHeaderAndType>> headers() const; |
132 | 133 |
133 // |element| will not be present for navigations to javascript URLs, | 134 // |element| will not be present for navigations to javascript URLs, |
134 // as those checks happen in the middle of the navigation algorithm, | 135 // as those checks happen in the middle of the navigation algorithm, |
135 // and we generally don't have access to the responsible element. | 136 // and we generally don't have access to the responsible element. |
136 bool allowJavaScriptURLs(Element*, | 137 bool allowJavaScriptURLs(Element*, |
137 const String& contextURL, | 138 const String& contextURL, |
138 const WTF::OrdinalNumber& contextLine, | 139 const WTF::OrdinalNumber& contextLine, |
139 ReportingStatus = SendReport) const; | 140 ReportingStatus = SendReport) const; |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 String m_disableEvalErrorMessage; | 410 String m_disableEvalErrorMessage; |
410 WebInsecureRequestPolicy m_insecureRequestPolicy; | 411 WebInsecureRequestPolicy m_insecureRequestPolicy; |
411 | 412 |
412 Member<CSPSource> m_selfSource; | 413 Member<CSPSource> m_selfSource; |
413 String m_selfProtocol; | 414 String m_selfProtocol; |
414 }; | 415 }; |
415 | 416 |
416 } // namespace blink | 417 } // namespace blink |
417 | 418 |
418 #endif | 419 #endif |
OLD | NEW |