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 #include "content/common/content_security_policy/csp_context.h" | 5 #include "content/common/content_security_policy/csp_context.h" |
6 | 6 |
7 namespace content { | 7 namespace content { |
8 | 8 |
9 CSPContext::CSPContext() : has_self_(false) {} | 9 CSPContext::CSPContext() : has_self_(false) {} |
10 | 10 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 } | 59 } |
60 | 60 |
61 const std::string& CSPContext::GetSelfScheme() { | 61 const std::string& CSPContext::GetSelfScheme() { |
62 return self_scheme_; | 62 return self_scheme_; |
63 } | 63 } |
64 | 64 |
65 bool CSPContext::SchemeShouldBypassCSP(const base::StringPiece& scheme) { | 65 bool CSPContext::SchemeShouldBypassCSP(const base::StringPiece& scheme) { |
66 return false; | 66 return false; |
67 } | 67 } |
68 | 68 |
| 69 bool CSPContext::IsOriginSafeToUseInCspViolation( |
| 70 const url::Origin& origin) const { |
| 71 return true; |
| 72 } |
| 73 |
69 bool CSPContext::SelfSchemeShouldBypassCsp() { | 74 bool CSPContext::SelfSchemeShouldBypassCsp() { |
70 if (!has_self_) | 75 if (!has_self_) |
71 return false; | 76 return false; |
72 return SchemeShouldBypassCSP(self_scheme_); | 77 return SchemeShouldBypassCSP(self_scheme_); |
73 } | 78 } |
74 | 79 |
75 void CSPContext::ReportContentSecurityPolicyViolation( | 80 void CSPContext::ReportContentSecurityPolicyViolation( |
76 const CSPViolationParams& violation_params) { | 81 const CSPViolationParams& violation_params) { |
77 return; | 82 return; |
78 } | 83 } |
(...skipping 19 matching lines...) Expand all Loading... |
98 disposition(disposition), | 103 disposition(disposition), |
99 after_redirect(after_redirect), | 104 after_redirect(after_redirect), |
100 source_location(source_location) {} | 105 source_location(source_location) {} |
101 | 106 |
102 CSPViolationParams::CSPViolationParams(const CSPViolationParams& other) = | 107 CSPViolationParams::CSPViolationParams(const CSPViolationParams& other) = |
103 default; | 108 default; |
104 | 109 |
105 CSPViolationParams::~CSPViolationParams() {} | 110 CSPViolationParams::~CSPViolationParams() {} |
106 | 111 |
107 } // namespace content | 112 } // namespace content |
OLD | NEW |