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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 , m_overrideInlineStyleAllowed(false) | 135 , m_overrideInlineStyleAllowed(false) |
136 , m_scriptHashAlgorithmsUsed(ContentSecurityPolicyHashAlgorithmNone) | 136 , m_scriptHashAlgorithmsUsed(ContentSecurityPolicyHashAlgorithmNone) |
137 , m_styleHashAlgorithmsUsed(ContentSecurityPolicyHashAlgorithmNone) | 137 , m_styleHashAlgorithmsUsed(ContentSecurityPolicyHashAlgorithmNone) |
138 { | 138 { |
139 } | 139 } |
140 | 140 |
141 ContentSecurityPolicy::~ContentSecurityPolicy() | 141 ContentSecurityPolicy::~ContentSecurityPolicy() |
142 { | 142 { |
143 } | 143 } |
144 | 144 |
| 145 Document* ContentSecurityPolicy::document() const |
| 146 { |
| 147 return m_executionContext->isDocument() ? toDocument(m_executionContext) : 0
; |
| 148 } |
| 149 |
145 void ContentSecurityPolicy::copyStateFrom(const ContentSecurityPolicy* other) | 150 void ContentSecurityPolicy::copyStateFrom(const ContentSecurityPolicy* other) |
146 { | 151 { |
147 ASSERT(m_policies.isEmpty()); | 152 ASSERT(m_policies.isEmpty()); |
148 for (CSPDirectiveListVector::const_iterator iter = other->m_policies.begin()
; iter != other->m_policies.end(); ++iter) | 153 for (CSPDirectiveListVector::const_iterator iter = other->m_policies.begin()
; iter != other->m_policies.end(); ++iter) |
149 addPolicyFromHeaderValue((*iter)->header(), (*iter)->headerType(), (*ite
r)->headerSource()); | 154 addPolicyFromHeaderValue((*iter)->header(), (*iter)->headerType(), (*ite
r)->headerSource()); |
150 } | 155 } |
151 | 156 |
152 void ContentSecurityPolicy::didReceiveHeaders(const ContentSecurityPolicyRespons
eHeaders& headers) | 157 void ContentSecurityPolicy::didReceiveHeaders(const ContentSecurityPolicyRespons
eHeaders& headers) |
153 { | 158 { |
154 if (!headers.contentSecurityPolicy().isEmpty()) | 159 if (!headers.contentSecurityPolicy().isEmpty()) |
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
777 // Collisions have no security impact, so we can save space by storing only
the string's hash rather than the whole report. | 782 // Collisions have no security impact, so we can save space by storing only
the string's hash rather than the whole report. |
778 return !m_violationReportsSent.contains(report.impl()->hash()); | 783 return !m_violationReportsSent.contains(report.impl()->hash()); |
779 } | 784 } |
780 | 785 |
781 void ContentSecurityPolicy::didSendViolationReport(const String& report) | 786 void ContentSecurityPolicy::didSendViolationReport(const String& report) |
782 { | 787 { |
783 m_violationReportsSent.add(report.impl()->hash()); | 788 m_violationReportsSent.add(report.impl()->hash()); |
784 } | 789 } |
785 | 790 |
786 } // namespace WebCore | 791 } // namespace WebCore |
OLD | NEW |