| 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 1195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1206 } | 1206 } |
| 1207 | 1207 |
| 1208 void UseCounter::countCrossOriginIframe(const Document& document, | 1208 void UseCounter::countCrossOriginIframe(const Document& document, |
| 1209 Feature feature) { | 1209 Feature feature) { |
| 1210 LocalFrame* frame = document.frame(); | 1210 LocalFrame* frame = document.frame(); |
| 1211 if (frame && frame->isCrossOriginSubframe()) | 1211 if (frame && frame->isCrossOriginSubframe()) |
| 1212 count(frame, feature); | 1212 count(frame, feature); |
| 1213 } | 1213 } |
| 1214 | 1214 |
| 1215 void UseCounter::count(CSSParserMode cssParserMode, CSSPropertyID property) { | 1215 void UseCounter::count(CSSParserMode cssParserMode, CSSPropertyID property) { |
| 1216 DCHECK(property >= firstCSSProperty); | 1216 DCHECK(isCSSPropertyIDWithName(property)); |
| 1217 DCHECK(property <= lastUnresolvedCSSProperty); | |
| 1218 | 1217 |
| 1219 if (!isUseCounterEnabledForMode(cssParserMode) || m_muteCount) | 1218 if (!isUseCounterEnabledForMode(cssParserMode) || m_muteCount) |
| 1220 return; | 1219 return; |
| 1221 | 1220 |
| 1222 if (!m_CSSRecorded.quickGet(property)) { | 1221 if (!m_CSSRecorded.quickGet(property)) { |
| 1223 // Note that HTTPArchive tooling looks specifically for this event - see htt
ps://github.com/HTTPArchive/httparchive/issues/59 | 1222 // Note that HTTPArchive tooling looks specifically for this event - see htt
ps://github.com/HTTPArchive/httparchive/issues/59 |
| 1224 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("blink.feature_usage"), | 1223 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("blink.feature_usage"), |
| 1225 "CSSFeatureFirstUsed", "feature", property); | 1224 "CSSFeatureFirstUsed", "feature", property); |
| 1226 cssHistogram().count(mapCSSPropertyIdToCSSSampleIdForHistogram(property)); | 1225 cssHistogram().count(mapCSSPropertyIdToCSSSampleIdForHistogram(property)); |
| 1227 m_CSSRecorded.quickSet(property); | 1226 m_CSSRecorded.quickSet(property); |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1337 } | 1336 } |
| 1338 } | 1337 } |
| 1339 | 1338 |
| 1340 if (needsPagesMeasuredUpdate) | 1339 if (needsPagesMeasuredUpdate) |
| 1341 cssPropertiesHistogram.count(totalPagesMeasuredCSSSampleId()); | 1340 cssPropertiesHistogram.count(totalPagesMeasuredCSSSampleId()); |
| 1342 | 1341 |
| 1343 m_CSSBits.clearAll(); | 1342 m_CSSBits.clearAll(); |
| 1344 } | 1343 } |
| 1345 | 1344 |
| 1346 } // namespace blink | 1345 } // namespace blink |
| OLD | NEW |