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 28 matching lines...) Expand all Loading... |
39 #include "platform/instrumentation/tracing/TraceEvent.h" | 39 #include "platform/instrumentation/tracing/TraceEvent.h" |
40 #include "platform/weborigin/SchemeRegistry.h" | 40 #include "platform/weborigin/SchemeRegistry.h" |
41 | 41 |
42 namespace { | 42 namespace { |
43 | 43 |
44 int totalPagesMeasuredCSSSampleId() { | 44 int totalPagesMeasuredCSSSampleId() { |
45 return 1; | 45 return 1; |
46 } | 46 } |
47 | 47 |
48 // Make sure update_use_counter_css.py was run which updates histograms.xml. | 48 // Make sure update_use_counter_css.py was run which updates histograms.xml. |
49 constexpr int kMaximumCSSSampleId = 584; | 49 constexpr int kMaximumCSSSampleId = 587; |
50 | 50 |
51 } // namespace | 51 } // namespace |
52 | 52 |
53 namespace blink { | 53 namespace blink { |
54 | 54 |
55 int UseCounter::MapCSSPropertyIdToCSSSampleIdForHistogram( | 55 int UseCounter::MapCSSPropertyIdToCSSSampleIdForHistogram( |
56 CSSPropertyID css_property_id) { | 56 CSSPropertyID css_property_id) { |
57 switch (css_property_id) { | 57 switch (css_property_id) { |
58 // Begin at 2, because 1 is reserved for totalPagesMeasuredCSSSampleId. | 58 // Begin at 2, because 1 is reserved for totalPagesMeasuredCSSSampleId. |
59 case CSSPropertyColor: | 59 case CSSPropertyColor: |
(...skipping 1061 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1121 case CSSPropertyScrollSnapMarginBlockEnd: | 1121 case CSSPropertyScrollSnapMarginBlockEnd: |
1122 return 580; | 1122 return 580; |
1123 case CSSPropertyScrollSnapMarginInline: | 1123 case CSSPropertyScrollSnapMarginInline: |
1124 return 581; | 1124 return 581; |
1125 case CSSPropertyScrollSnapMarginInlineStart: | 1125 case CSSPropertyScrollSnapMarginInlineStart: |
1126 return 582; | 1126 return 582; |
1127 case CSSPropertyScrollSnapMarginInlineEnd: | 1127 case CSSPropertyScrollSnapMarginInlineEnd: |
1128 return 583; | 1128 return 583; |
1129 case CSSPropertyScrollSnapStop: | 1129 case CSSPropertyScrollSnapStop: |
1130 return 584; | 1130 return 584; |
| 1131 case CSSPropertyScrollBoundaryBehavior: |
| 1132 return 585; |
| 1133 case CSSPropertyScrollBoundaryBehaviorX: |
| 1134 return 586; |
| 1135 case CSSPropertyScrollBoundaryBehaviorY: |
| 1136 return 587; |
1131 // 1. Add new features above this line (don't change the assigned numbers of | 1137 // 1. Add new features above this line (don't change the assigned numbers of |
1132 // the existing items). | 1138 // the existing items). |
1133 // 2. Update kMaximumCSSSampleId with the new maximum value. | 1139 // 2. Update kMaximumCSSSampleId with the new maximum value. |
1134 // 3. Run the update_use_counter_css.py script in | 1140 // 3. Run the update_use_counter_css.py script in |
1135 // chromium/src/tools/metrics/histograms to update the UMA histogram names. | 1141 // chromium/src/tools/metrics/histograms to update the UMA histogram names. |
1136 | 1142 |
1137 case CSSPropertyInvalid: | 1143 case CSSPropertyInvalid: |
1138 NOTREACHED(); | 1144 NOTREACHED(); |
1139 return 0; | 1145 return 0; |
1140 } | 1146 } |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1477 } | 1483 } |
1478 } | 1484 } |
1479 | 1485 |
1480 if (needs_pages_measured_update) | 1486 if (needs_pages_measured_update) |
1481 css_properties_histogram.Count(totalPagesMeasuredCSSSampleId()); | 1487 css_properties_histogram.Count(totalPagesMeasuredCSSSampleId()); |
1482 | 1488 |
1483 css_bits_.ClearAll(); | 1489 css_bits_.ClearAll(); |
1484 } | 1490 } |
1485 | 1491 |
1486 } // namespace blink | 1492 } // namespace blink |
OLD | NEW |