| 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 27 matching lines...) Expand all Loading... |
| 38 #include "platform/Histogram.h" | 38 #include "platform/Histogram.h" |
| 39 #include "platform/tracing/TraceEvent.h" | 39 #include "platform/tracing/TraceEvent.h" |
| 40 | 40 |
| 41 namespace { | 41 namespace { |
| 42 | 42 |
| 43 int totalPagesMeasuredCSSSampleId() { | 43 int totalPagesMeasuredCSSSampleId() { |
| 44 return 1; | 44 return 1; |
| 45 } | 45 } |
| 46 | 46 |
| 47 // Make sure update_use_counter_css.py was run which updates histograms.xml. | 47 // Make sure update_use_counter_css.py was run which updates histograms.xml. |
| 48 constexpr int kMaximumCSSSampleId = 548; | 48 constexpr int kMaximumCSSSampleId = 549; |
| 49 | 49 |
| 50 } // namespace | 50 } // namespace |
| 51 | 51 |
| 52 namespace blink { | 52 namespace blink { |
| 53 | 53 |
| 54 int UseCounter::mapCSSPropertyIdToCSSSampleIdForHistogram( | 54 int UseCounter::mapCSSPropertyIdToCSSSampleIdForHistogram( |
| 55 CSSPropertyID cssPropertyID) { | 55 CSSPropertyID cssPropertyID) { |
| 56 switch (cssPropertyID) { | 56 switch (cssPropertyID) { |
| 57 // Begin at 2, because 1 is reserved for totalPagesMeasuredCSSSampleId. | 57 // Begin at 2, because 1 is reserved for totalPagesMeasuredCSSSampleId. |
| 58 case CSSPropertyColor: | 58 case CSSPropertyColor: |
| (...skipping 998 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1057 case CSSPropertyOffsetAnchor: | 1057 case CSSPropertyOffsetAnchor: |
| 1058 return 544; | 1058 return 544; |
| 1059 case CSSPropertyOffsetPosition: | 1059 case CSSPropertyOffsetPosition: |
| 1060 return 545; | 1060 return 545; |
| 1061 case CSSPropertyTextDecorationSkip: | 1061 case CSSPropertyTextDecorationSkip: |
| 1062 return 546; | 1062 return 546; |
| 1063 case CSSPropertyCaretColor: | 1063 case CSSPropertyCaretColor: |
| 1064 return 547; | 1064 return 547; |
| 1065 case CSSPropertyOffsetRotate: | 1065 case CSSPropertyOffsetRotate: |
| 1066 return 548; | 1066 return 548; |
| 1067 case CSSPropertyFontVariationSettings: |
| 1068 return 549; |
| 1067 // 1. Add new features above this line (don't change the assigned numbers of | 1069 // 1. Add new features above this line (don't change the assigned numbers of |
| 1068 // the existing items). | 1070 // the existing items). |
| 1069 // 2. Update kMaximumCSSSampleId with the new maximum value. | 1071 // 2. Update kMaximumCSSSampleId with the new maximum value. |
| 1070 // 3. Run the update_use_counter_css.py script in | 1072 // 3. Run the update_use_counter_css.py script in |
| 1071 // chromium/src/tools/metrics/histograms to update the UMA histogram names. | 1073 // chromium/src/tools/metrics/histograms to update the UMA histogram names. |
| 1072 | 1074 |
| 1073 case CSSPropertyInvalid: | 1075 case CSSPropertyInvalid: |
| 1074 ASSERT_NOT_REACHED(); | 1076 ASSERT_NOT_REACHED(); |
| 1075 return 0; | 1077 return 0; |
| 1076 } | 1078 } |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1347 } | 1349 } |
| 1348 } | 1350 } |
| 1349 | 1351 |
| 1350 if (needsPagesMeasuredUpdate) | 1352 if (needsPagesMeasuredUpdate) |
| 1351 cssPropertiesHistogram.count(totalPagesMeasuredCSSSampleId()); | 1353 cssPropertiesHistogram.count(totalPagesMeasuredCSSSampleId()); |
| 1352 | 1354 |
| 1353 m_CSSBits.clearAll(); | 1355 m_CSSBits.clearAll(); |
| 1354 } | 1356 } |
| 1355 | 1357 |
| 1356 } // namespace blink | 1358 } // namespace blink |
| OLD | NEW |