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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
169 // flags, then dump all the parsing error messages, then poke at histograms. | 169 // flags, then dump all the parsing error messages, then poke at histograms. |
170 if (Document* document = this->document()) { | 170 if (Document* document = this->document()) { |
171 if (m_sandboxMask != SandboxNone) { | 171 if (m_sandboxMask != SandboxNone) { |
172 UseCounter::count(document, UseCounter::SandboxViaCSP); | 172 UseCounter::count(document, UseCounter::SandboxViaCSP); |
173 document->enforceSandboxFlags(m_sandboxMask); | 173 document->enforceSandboxFlags(m_sandboxMask); |
174 } | 174 } |
175 if (m_enforceStrictMixedContentChecking) | 175 if (m_enforceStrictMixedContentChecking) |
176 document->enforceStrictMixedContentChecking(); | 176 document->enforceStrictMixedContentChecking(); |
177 if (didSetReferrerPolicy()) | 177 if (didSetReferrerPolicy()) |
178 document->setReferrerPolicy(m_referrerPolicy); | 178 document->setReferrerPolicy(m_referrerPolicy); |
179 if (m_insecureRequestsPolicy > document->insecureRequestsPolicy()) | 179 if (m_insecureRequestsPolicy > document->insecureRequestsPolicy()) { |
180 document->setInsecureRequestsPolicy(m_insecureRequestsPolicy); | 180 document->setInsecureRequestsPolicy(m_insecureRequestsPolicy); |
181 document->addInsecureNavigationUpgrade(securityOrigin()->host().impl ()->hash()); | |
182 } | |
Yoav Weiss
2015/03/17 15:17:27
Are we sure that securityOrigin is not null? Same
Mike West
2015/03/18 09:31:53
ASSERT and isNull() added.
| |
181 | 183 |
182 for (const auto& consoleMessage : m_consoleMessages) | 184 for (const auto& consoleMessage : m_consoleMessages) |
183 m_executionContext->addConsoleMessage(consoleMessage); | 185 m_executionContext->addConsoleMessage(consoleMessage); |
184 m_consoleMessages.clear(); | 186 m_consoleMessages.clear(); |
185 | 187 |
186 for (const auto& policy : m_policies) | 188 for (const auto& policy : m_policies) |
187 UseCounter::count(*document, getUseCounterType(policy->headerType()) ); | 189 UseCounter::count(*document, getUseCounterType(policy->headerType()) ); |
188 } | 190 } |
189 | 191 |
190 // We disable 'eval()' even in the case of report-only policies, and rely on the check in the | 192 // We disable 'eval()' even in the case of report-only policies, and rely on the check in the |
(...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
927 // Collisions have no security impact, so we can save space by storing only the string's hash rather than the whole report. | 929 // Collisions have no security impact, so we can save space by storing only the string's hash rather than the whole report. |
928 return !m_violationReportsSent.contains(report.impl()->hash()); | 930 return !m_violationReportsSent.contains(report.impl()->hash()); |
929 } | 931 } |
930 | 932 |
931 void ContentSecurityPolicy::didSendViolationReport(const String& report) | 933 void ContentSecurityPolicy::didSendViolationReport(const String& report) |
932 { | 934 { |
933 m_violationReportsSent.add(report.impl()->hash()); | 935 m_violationReportsSent.add(report.impl()->hash()); |
934 } | 936 } |
935 | 937 |
936 } // namespace blink | 938 } // namespace blink |
OLD | NEW |