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 = 545; | 48 constexpr int kMaximumCSSSampleId = 546; |
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 992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1051 case CSSPropertyOffsetPath: | 1051 case CSSPropertyOffsetPath: |
1052 return 541; | 1052 return 541; |
1053 case CSSPropertyOffsetRotation: | 1053 case CSSPropertyOffsetRotation: |
1054 return 542; | 1054 return 542; |
1055 case CSSPropertyOffset: | 1055 case CSSPropertyOffset: |
1056 return 543; | 1056 return 543; |
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: |
| 1062 return 546; |
1061 // 1. Add new features above this line (don't change the assigned numbers of | 1063 // 1. Add new features above this line (don't change the assigned numbers of |
1062 // the existing items). | 1064 // the existing items). |
1063 // 2. Update kMaximumCSSSampleId with the new maximum value. | 1065 // 2. Update kMaximumCSSSampleId with the new maximum value. |
1064 // 3. Run the update_use_counter_css.py script in | 1066 // 3. Run the update_use_counter_css.py script in |
1065 // chromium/src/tools/metrics/histograms to update the UMA histogram names. | 1067 // chromium/src/tools/metrics/histograms to update the UMA histogram names. |
1066 | 1068 |
1067 case CSSPropertyInvalid: | 1069 case CSSPropertyInvalid: |
1068 ASSERT_NOT_REACHED(); | 1070 ASSERT_NOT_REACHED(); |
1069 return 0; | 1071 return 0; |
1070 } | 1072 } |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1340 } | 1342 } |
1341 } | 1343 } |
1342 | 1344 |
1343 if (needsPagesMeasuredUpdate) | 1345 if (needsPagesMeasuredUpdate) |
1344 cssPropertiesHistogram.count(totalPagesMeasuredCSSSampleId()); | 1346 cssPropertiesHistogram.count(totalPagesMeasuredCSSSampleId()); |
1345 | 1347 |
1346 m_CSSBits.clearAll(); | 1348 m_CSSBits.clearAll(); |
1347 } | 1349 } |
1348 | 1350 |
1349 } // namespace blink | 1351 } // namespace blink |
OLD | NEW |