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