| 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 } | |
| 183 | 181 |
| 184 for (const auto& consoleMessage : m_consoleMessages) | 182 for (const auto& consoleMessage : m_consoleMessages) |
| 185 m_executionContext->addConsoleMessage(consoleMessage); | 183 m_executionContext->addConsoleMessage(consoleMessage); |
| 186 m_consoleMessages.clear(); | 184 m_consoleMessages.clear(); |
| 187 | 185 |
| 188 for (const auto& policy : m_policies) | 186 for (const auto& policy : m_policies) |
| 189 UseCounter::count(*document, getUseCounterType(policy->headerType())
); | 187 UseCounter::count(*document, getUseCounterType(policy->headerType())
); |
| 190 } | 188 } |
| 191 | 189 |
| 192 // We disable 'eval()' even in the case of report-only policies, and rely on
the check in the | 190 // We disable 'eval()' even in the case of report-only policies, and rely on
the check in the |
| (...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 920 // Collisions have no security impact, so we can save space by storing only
the string's hash rather than the whole report. | 918 // Collisions have no security impact, so we can save space by storing only
the string's hash rather than the whole report. |
| 921 return !m_violationReportsSent.contains(report.impl()->hash()); | 919 return !m_violationReportsSent.contains(report.impl()->hash()); |
| 922 } | 920 } |
| 923 | 921 |
| 924 void ContentSecurityPolicy::didSendViolationReport(const String& report) | 922 void ContentSecurityPolicy::didSendViolationReport(const String& report) |
| 925 { | 923 { |
| 926 m_violationReportsSent.add(report.impl()->hash()); | 924 m_violationReportsSent.add(report.impl()->hash()); |
| 927 } | 925 } |
| 928 | 926 |
| 929 } // namespace blink | 927 } // namespace blink |
| OLD | NEW |