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

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

Issue 1035683003: Add metrics for 'upgrade-insecure-requests'. (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
« no previous file with comments | « Source/core/frame/UseCounter.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 // flags, then dump all the parsing error messages, then poke at histograms. 170 // flags, then dump all the parsing error messages, then poke at histograms.
171 if (Document* document = this->document()) { 171 if (Document* document = this->document()) {
172 if (m_sandboxMask != SandboxNone) { 172 if (m_sandboxMask != SandboxNone) {
173 UseCounter::count(document, UseCounter::SandboxViaCSP); 173 UseCounter::count(document, UseCounter::SandboxViaCSP);
174 document->enforceSandboxFlags(m_sandboxMask); 174 document->enforceSandboxFlags(m_sandboxMask);
175 } 175 }
176 if (m_enforceStrictMixedContentChecking) 176 if (m_enforceStrictMixedContentChecking)
177 document->enforceStrictMixedContentChecking(); 177 document->enforceStrictMixedContentChecking();
178 if (didSetReferrerPolicy()) 178 if (didSetReferrerPolicy())
179 document->setReferrerPolicy(m_referrerPolicy); 179 document->setReferrerPolicy(m_referrerPolicy);
180 if (m_insecureRequestsPolicy > document->insecureRequestsPolicy()) { 180 if (m_insecureRequestsPolicy == SecurityContext::InsecureRequestsUpgrade ) {
Mike West 2015/03/25 12:12:46 `>` made sense when reporting was bundled up with
181 UseCounter::count(document, UseCounter::UpgradingInsecureRequests);
181 document->setInsecureRequestsPolicy(m_insecureRequestsPolicy); 182 document->setInsecureRequestsPolicy(m_insecureRequestsPolicy);
182 if (!securityOrigin()->host().isNull()) 183 if (!securityOrigin()->host().isNull())
183 document->addInsecureNavigationUpgrade(securityOrigin()->host(). impl()->hash()); 184 document->addInsecureNavigationUpgrade(securityOrigin()->host(). impl()->hash());
184 } 185 }
185 186
186 for (const auto& consoleMessage : m_consoleMessages) 187 for (const auto& consoleMessage : m_consoleMessages)
187 m_executionContext->addConsoleMessage(consoleMessage); 188 m_executionContext->addConsoleMessage(consoleMessage);
188 m_consoleMessages.clear(); 189 m_consoleMessages.clear();
189 190
190 for (const auto& policy : m_policies) 191 for (const auto& policy : m_policies)
(...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after
940 // Collisions have no security impact, so we can save space by storing only the string's hash rather than the whole report. 941 // Collisions have no security impact, so we can save space by storing only the string's hash rather than the whole report.
941 return !m_violationReportsSent.contains(report.impl()->hash()); 942 return !m_violationReportsSent.contains(report.impl()->hash());
942 } 943 }
943 944
944 void ContentSecurityPolicy::didSendViolationReport(const String& report) 945 void ContentSecurityPolicy::didSendViolationReport(const String& report)
945 { 946 {
946 m_violationReportsSent.add(report.impl()->hash()); 947 m_violationReportsSent.add(report.impl()->hash());
947 } 948 }
948 949
949 } // namespace blink 950 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/frame/UseCounter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698