Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google, Inc. All rights reserved. | 2 * Copyright (C) 2012 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 1157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1168 // Note that SVGImage cases always have an about:blank URL | 1168 // Note that SVGImage cases always have an about:blank URL |
| 1169 if (m_context == DefaultContext && | 1169 if (m_context == DefaultContext && |
| 1170 !SchemeRegistry::shouldTrackUsageMetricsForScheme(url.protocol())) { | 1170 !SchemeRegistry::shouldTrackUsageMetricsForScheme(url.protocol())) { |
| 1171 m_disableReporting = true; | 1171 m_disableReporting = true; |
| 1172 } | 1172 } |
| 1173 | 1173 |
| 1174 m_featuresRecorded.clearAll(); | 1174 m_featuresRecorded.clearAll(); |
| 1175 m_CSSRecorded.clearAll(); | 1175 m_CSSRecorded.clearAll(); |
| 1176 m_animatedCSSRecorded.clearAll(); | 1176 m_animatedCSSRecorded.clearAll(); |
| 1177 if (!m_disableReporting && !m_muteCount) { | 1177 if (!m_disableReporting && !m_muteCount) { |
| 1178 featuresHistogram().count(PageVisits); | 1178 if (url.protocolIs("chrome-extension")) |
|
Rick Byers
2017/04/07 17:46:54
I think m_disableReporting will still be true in t
| |
| 1179 extensionFeaturesHistogram().count(PageVisits); | |
| 1180 else | |
| 1181 featuresHistogram().count(PageVisits); | |
| 1179 cssHistogram().count(totalPagesMeasuredCSSSampleId()); | 1182 cssHistogram().count(totalPagesMeasuredCSSSampleId()); |
| 1180 animatedCSSHistogram().count(totalPagesMeasuredCSSSampleId()); | 1183 animatedCSSHistogram().count(totalPagesMeasuredCSSSampleId()); |
| 1181 } | 1184 } |
| 1182 } | 1185 } |
| 1183 | 1186 |
| 1184 void UseCounter::count(const Frame* frame, Feature feature) { | 1187 void UseCounter::count(const Frame* frame, Feature feature) { |
| 1185 if (!frame) | 1188 if (!frame) |
| 1186 return; | 1189 return; |
| 1187 Page* page = frame->page(); | 1190 Page* page = frame->page(); |
| 1188 if (!page) | 1191 if (!page) |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1327 DEFINE_STATIC_LOCAL( | 1330 DEFINE_STATIC_LOCAL( |
| 1328 blink::EnumerationHistogram, histogram, | 1331 blink::EnumerationHistogram, histogram, |
| 1329 ("Blink.UseCounter.Features", blink::UseCounter::NumberOfFeatures)); | 1332 ("Blink.UseCounter.Features", blink::UseCounter::NumberOfFeatures)); |
| 1330 DEFINE_STATIC_LOCAL(blink::EnumerationHistogram, svgHistogram, | 1333 DEFINE_STATIC_LOCAL(blink::EnumerationHistogram, svgHistogram, |
| 1331 ("Blink.UseCounter.SVGImage.Features", | 1334 ("Blink.UseCounter.SVGImage.Features", |
| 1332 blink::UseCounter::NumberOfFeatures)); | 1335 blink::UseCounter::NumberOfFeatures)); |
| 1333 | 1336 |
| 1334 return m_context == SVGImageContext ? svgHistogram : histogram; | 1337 return m_context == SVGImageContext ? svgHistogram : histogram; |
| 1335 } | 1338 } |
| 1336 | 1339 |
| 1340 EnumerationHistogram& UseCounter::extensionFeaturesHistogram() const { | |
| 1341 DEFINE_STATIC_LOCAL(blink::EnumerationHistogram, histogram, | |
| 1342 ("Blink.UseCounter.Extensions.Features", | |
| 1343 blink::UseCounter::NumberOfFeatures)); | |
| 1344 return histogram; | |
| 1345 } | |
| 1346 | |
| 1337 EnumerationHistogram& UseCounter::cssHistogram() const { | 1347 EnumerationHistogram& UseCounter::cssHistogram() const { |
| 1338 DEFINE_STATIC_LOCAL(blink::EnumerationHistogram, histogram, | 1348 DEFINE_STATIC_LOCAL(blink::EnumerationHistogram, histogram, |
| 1339 ("Blink.UseCounter.CSSProperties", kMaximumCSSSampleId)); | 1349 ("Blink.UseCounter.CSSProperties", kMaximumCSSSampleId)); |
| 1340 DEFINE_STATIC_LOCAL( | 1350 DEFINE_STATIC_LOCAL( |
| 1341 blink::EnumerationHistogram, svgHistogram, | 1351 blink::EnumerationHistogram, svgHistogram, |
| 1342 ("Blink.UseCounter.SVGImage.CSSProperties", kMaximumCSSSampleId)); | 1352 ("Blink.UseCounter.SVGImage.CSSProperties", kMaximumCSSSampleId)); |
| 1343 | 1353 |
| 1344 return m_context == SVGImageContext ? svgHistogram : histogram; | 1354 return m_context == SVGImageContext ? svgHistogram : histogram; |
| 1345 } | 1355 } |
| 1346 | 1356 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1413 } | 1423 } |
| 1414 } | 1424 } |
| 1415 | 1425 |
| 1416 if (needsPagesMeasuredUpdate) | 1426 if (needsPagesMeasuredUpdate) |
| 1417 cssPropertiesHistogram.count(totalPagesMeasuredCSSSampleId()); | 1427 cssPropertiesHistogram.count(totalPagesMeasuredCSSSampleId()); |
| 1418 | 1428 |
| 1419 m_CSSBits.clearAll(); | 1429 m_CSSBits.clearAll(); |
| 1420 } | 1430 } |
| 1421 | 1431 |
| 1422 } // namespace blink | 1432 } // namespace blink |
| OLD | NEW |