OLD | NEW |
---|---|
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_COMMON_CONTENT_SECURITY_POLICY_CSP_CONTEXT_H_ | 5 #ifndef CONTENT_COMMON_CONTENT_SECURITY_POLICY_CSP_CONTEXT_H_ |
6 #define CONTENT_COMMON_CONTENT_SECURITY_POLICY_CSP_CONTEXT_H_ | 6 #define CONTENT_COMMON_CONTENT_SECURITY_POLICY_CSP_CONTEXT_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
48 | 48 |
49 bool SelfSchemeShouldBypassCsp(); | 49 bool SelfSchemeShouldBypassCsp(); |
50 | 50 |
51 void ResetContentSecurityPolicies() { policies_.clear(); } | 51 void ResetContentSecurityPolicies() { policies_.clear(); } |
52 void AddContentSecurityPolicy(const ContentSecurityPolicy& policy) { | 52 void AddContentSecurityPolicy(const ContentSecurityPolicy& policy) { |
53 policies_.push_back(policy); | 53 policies_.push_back(policy); |
54 } | 54 } |
55 | 55 |
56 virtual bool SchemeShouldBypassCSP(const base::StringPiece& scheme); | 56 virtual bool SchemeShouldBypassCSP(const base::StringPiece& scheme); |
57 | 57 |
58 // For security reasons, some urls must not be disclosed in console error | |
59 // messages, source location and reports. When this function returns false, | |
alexmos
2017/05/10 22:33:08
Note: using those URLs in console error messages i
arthursonzogni
2017/05/11 13:06:23
Yes, using those URLs will be fine as soon as we w
| |
60 // only the url's origin is displayed instead. | |
alexmos
2017/05/10 22:33:08
This latter part doesn't apply to SourceLocation,
arthursonzogni
2017/05/11 13:06:23
source_location is used in console message and in
| |
61 virtual bool IsOriginSafeToUseInCspViolation(const url::Origin& origin) const; | |
62 | |
58 private: | 63 private: |
59 bool has_self_ = false; | 64 bool has_self_ = false; |
60 std::string self_scheme_; | 65 std::string self_scheme_; |
61 CSPSource self_source_; | 66 CSPSource self_source_; |
62 | 67 |
63 std::vector<ContentSecurityPolicy> policies_; | 68 std::vector<ContentSecurityPolicy> policies_; |
64 | 69 |
65 DISALLOW_COPY_AND_ASSIGN(CSPContext); | 70 DISALLOW_COPY_AND_ASSIGN(CSPContext); |
66 }; | 71 }; |
67 | 72 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
106 | 111 |
107 // Whether or not the violation happens after a redirect. | 112 // Whether or not the violation happens after a redirect. |
108 bool after_redirect; | 113 bool after_redirect; |
109 | 114 |
110 // The source code location that triggered the blocked navigation. | 115 // The source code location that triggered the blocked navigation. |
111 SourceLocation source_location; | 116 SourceLocation source_location; |
112 }; | 117 }; |
113 | 118 |
114 } // namespace content | 119 } // namespace content |
115 #endif // CONTENT_COMMON_CONTENT_SECURITY_POLICY_CSP_CONTEXT_H_ | 120 #endif // CONTENT_COMMON_CONTENT_SECURITY_POLICY_CSP_CONTEXT_H_ |
OLD | NEW |