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

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

Issue 2080203003: Rename UseCounter::CSPWithUnsafeDynamic to UseCounter::CSPWithStrictDynamic. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 } 196 }
197 197
198 for (const auto& consoleMessage : m_consoleMessages) 198 for (const auto& consoleMessage : m_consoleMessages)
199 m_executionContext->addConsoleMessage(consoleMessage); 199 m_executionContext->addConsoleMessage(consoleMessage);
200 m_consoleMessages.clear(); 200 m_consoleMessages.clear();
201 201
202 for (const auto& policy : m_policies) 202 for (const auto& policy : m_policies)
203 UseCounter::count(*document, getUseCounterType(policy->headerType()) ); 203 UseCounter::count(*document, getUseCounterType(policy->headerType()) );
204 204
205 if (allowDynamic()) 205 if (allowDynamic())
206 UseCounter::count(*document, UseCounter::CSPWithUnsafeDynamic); 206 UseCounter::count(*document, UseCounter::CSPWithStrictDynamic);
207 } 207 }
208 208
209 // We disable 'eval()' even in the case of report-only policies, and rely on the check in the 209 // We disable 'eval()' even in the case of report-only policies, and rely on the check in the
210 // V8Initializer::codeGenerationCheckCallbackInMainThread callback to determ ine whether the 210 // V8Initializer::codeGenerationCheckCallbackInMainThread callback to determ ine whether the
211 // call should execute or not. 211 // call should execute or not.
212 if (!m_disableEvalErrorMessage.isNull()) 212 if (!m_disableEvalErrorMessage.isNull())
213 m_executionContext->disableEval(m_disableEvalErrorMessage); 213 m_executionContext->disableEval(m_disableEvalErrorMessage);
214 } 214 }
215 215
216 ContentSecurityPolicy::~ContentSecurityPolicy() 216 ContentSecurityPolicy::~ContentSecurityPolicy()
(...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after
1095 // Collisions have no security impact, so we can save space by storing only the string's hash rather than the whole report. 1095 // Collisions have no security impact, so we can save space by storing only the string's hash rather than the whole report.
1096 return !m_violationReportsSent.contains(report.impl()->hash()); 1096 return !m_violationReportsSent.contains(report.impl()->hash());
1097 } 1097 }
1098 1098
1099 void ContentSecurityPolicy::didSendViolationReport(const String& report) 1099 void ContentSecurityPolicy::didSendViolationReport(const String& report)
1100 { 1100 {
1101 m_violationReportsSent.add(report.impl()->hash()); 1101 m_violationReportsSent.add(report.impl()->hash());
1102 } 1102 }
1103 1103
1104 } // namespace blink 1104 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/UseCounter.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698