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 1163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1174 animated_css_recorded_.ClearAll(); | 1174 animated_css_recorded_.ClearAll(); |
| 1175 if (context_ != kDisabledContext && !mute_count_) { | 1175 if (context_ != kDisabledContext && !mute_count_) { |
| 1176 FeaturesHistogram().Count(kPageVisits); | 1176 FeaturesHistogram().Count(kPageVisits); |
| 1177 if (context_ != kExtensionContext) { | 1177 if (context_ != kExtensionContext) { |
| 1178 CssHistogram().Count(totalPagesMeasuredCSSSampleId()); | 1178 CssHistogram().Count(totalPagesMeasuredCSSSampleId()); |
| 1179 AnimatedCSSHistogram().Count(totalPagesMeasuredCSSSampleId()); | 1179 AnimatedCSSHistogram().Count(totalPagesMeasuredCSSSampleId()); |
| 1180 } | 1180 } |
| 1181 } | 1181 } |
| 1182 } | 1182 } |
| 1183 | 1183 |
| 1184 void UseCounter::Count(const Frame* frame, Feature feature) { | 1184 void UseCounter::Count(const LocalFrame* frame, Feature feature) { |
| 1185 if (!frame) | 1185 if (!frame) |
| 1186 return; | 1186 return; |
| 1187 Page* page = frame->GetPage(); | 1187 Page* page = frame->GetPage(); |
| 1188 if (!page) | 1188 if (!page) |
| 1189 return; | 1189 return; |
| 1190 | 1190 |
| 1191 page->GetUseCounter().Count(feature); | 1191 page->GetUseCounter().Count(feature); |
| 1192 } | 1192 } |
| 1193 | 1193 |
| 1194 void UseCounter::Count(const Document& document, Feature feature) { | 1194 void UseCounter::Count(const Document& document, Feature feature) { |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1253 if (context_ != kDisabledContext && context_ != kExtensionContext) { | 1253 if (context_ != kDisabledContext && context_ != kExtensionContext) { |
| 1254 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("blink.feature_usage"), | 1254 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("blink.feature_usage"), |
| 1255 "CSSFirstUsed", "feature", sample_id); | 1255 "CSSFirstUsed", "feature", sample_id); |
| 1256 CssHistogram().Count(sample_id); | 1256 CssHistogram().Count(sample_id); |
| 1257 } | 1257 } |
| 1258 css_recorded_.QuickSet(property); | 1258 css_recorded_.QuickSet(property); |
| 1259 } | 1259 } |
| 1260 legacy_counter_.CountCSS(property); | 1260 legacy_counter_.CountCSS(property); |
| 1261 } | 1261 } |
| 1262 | 1262 |
| 1263 void UseCounter::Count(Feature feature) { | 1263 void UseCounter::Count(Feature feature, const LocalFrame* sourceFrame) { |
|
dcheng
2017/05/27 08:16:21
Nit: source_frame
Rick Byers
2017/05/28 18:19:15
Done, thanks
| |
| 1264 // TODO(rbyers): Report UseCounter to browser process along with page | |
| 1265 // load metrics for sourceFrame crbug.com/716565 | |
| 1264 RecordMeasurement(feature); | 1266 RecordMeasurement(feature); |
| 1265 } | 1267 } |
| 1266 | 1268 |
| 1267 bool UseCounter::IsCountedAnimatedCSS(CSSPropertyID unresolved_property) { | 1269 bool UseCounter::IsCountedAnimatedCSS(CSSPropertyID unresolved_property) { |
| 1268 return animated_css_recorded_.QuickGet(unresolved_property); | 1270 return animated_css_recorded_.QuickGet(unresolved_property); |
| 1269 } | 1271 } |
| 1270 | 1272 |
| 1271 bool UseCounter::IsCountedAnimatedCSS(Document& document, | 1273 bool UseCounter::IsCountedAnimatedCSS(Document& document, |
| 1272 const String& string) { | 1274 const String& string) { |
| 1273 Page* page = document.GetPage(); | 1275 Page* page = document.GetPage(); |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1427 } | 1429 } |
| 1428 } | 1430 } |
| 1429 | 1431 |
| 1430 if (needs_pages_measured_update) | 1432 if (needs_pages_measured_update) |
| 1431 css_properties_histogram.Count(totalPagesMeasuredCSSSampleId()); | 1433 css_properties_histogram.Count(totalPagesMeasuredCSSSampleId()); |
| 1432 | 1434 |
| 1433 css_bits_.ClearAll(); | 1435 css_bits_.ClearAll(); |
| 1434 } | 1436 } |
| 1435 | 1437 |
| 1436 } // namespace blink | 1438 } // namespace blink |
| OLD | NEW |