Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(554)

Side by Side Diff: Source/core/frame/csp/ContentSecurityPolicy.cpp

Issue 978323002: Upgrade insecure requests: Pipe navigational hosts down into nested documents. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 }
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 727 matching lines...) Expand 10 before | Expand all | Expand 10 after
918 // Collisions have no security impact, so we can save space by storing only the string's hash rather than the whole report. 920 // Collisions have no security impact, so we can save space by storing only the string's hash rather than the whole report.
919 return !m_violationReportsSent.contains(report.impl()->hash()); 921 return !m_violationReportsSent.contains(report.impl()->hash());
920 } 922 }
921 923
922 void ContentSecurityPolicy::didSendViolationReport(const String& report) 924 void ContentSecurityPolicy::didSendViolationReport(const String& report)
923 { 925 {
924 m_violationReportsSent.add(report.impl()->hash()); 926 m_violationReportsSent.add(report.impl()->hash());
925 } 927 }
926 928
927 } // namespace blink 929 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/fetch/ResourceFetcherTest.cpp ('k') | Source/core/frame/csp/ContentSecurityPolicyTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698