| 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 = 560; | 49 constexpr int kMaximumCSSSampleId = 584; |
| 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 1017 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1077 case CSSPropertyAliasLineBreak: | 1077 case CSSPropertyAliasLineBreak: |
| 1078 return 556; | 1078 return 556; |
| 1079 case CSSPropertyPlaceContent: | 1079 case CSSPropertyPlaceContent: |
| 1080 return 557; | 1080 return 557; |
| 1081 case CSSPropertyPlaceItems: | 1081 case CSSPropertyPlaceItems: |
| 1082 return 558; | 1082 return 558; |
| 1083 case CSSPropertyTransformBox: | 1083 case CSSPropertyTransformBox: |
| 1084 return 559; | 1084 return 559; |
| 1085 case CSSPropertyPlaceSelf: | 1085 case CSSPropertyPlaceSelf: |
| 1086 return 560; | 1086 return 560; |
| 1087 case CSSPropertyScrollSnapAlign: |
| 1088 return 561; |
| 1089 case CSSPropertyScrollPadding: |
| 1090 return 562; |
| 1091 case CSSPropertyScrollPaddingTop: |
| 1092 return 563; |
| 1093 case CSSPropertyScrollPaddingRight: |
| 1094 return 564; |
| 1095 case CSSPropertyScrollPaddingBottom: |
| 1096 return 565; |
| 1097 case CSSPropertyScrollPaddingLeft: |
| 1098 return 566; |
| 1099 case CSSPropertyScrollPaddingBlock: |
| 1100 return 567; |
| 1101 case CSSPropertyScrollPaddingBlockStart: |
| 1102 return 568; |
| 1103 case CSSPropertyScrollPaddingBlockEnd: |
| 1104 return 569; |
| 1105 case CSSPropertyScrollPaddingInline: |
| 1106 return 570; |
| 1107 case CSSPropertyScrollPaddingInlineStart: |
| 1108 return 571; |
| 1109 case CSSPropertyScrollPaddingInlineEnd: |
| 1110 return 572; |
| 1111 case CSSPropertyScrollSnapMargin: |
| 1112 return 573; |
| 1113 case CSSPropertyScrollSnapMarginTop: |
| 1114 return 574; |
| 1115 case CSSPropertyScrollSnapMarginRight: |
| 1116 return 575; |
| 1117 case CSSPropertyScrollSnapMarginBottom: |
| 1118 return 576; |
| 1119 case CSSPropertyScrollSnapMarginLeft: |
| 1120 return 577; |
| 1121 case CSSPropertyScrollSnapMarginBlock: |
| 1122 return 578; |
| 1123 case CSSPropertyScrollSnapMarginBlockStart: |
| 1124 return 579; |
| 1125 case CSSPropertyScrollSnapMarginBlockEnd: |
| 1126 return 580; |
| 1127 case CSSPropertyScrollSnapMarginInline: |
| 1128 return 581; |
| 1129 case CSSPropertyScrollSnapMarginInlineStart: |
| 1130 return 582; |
| 1131 case CSSPropertyScrollSnapMarginInlineEnd: |
| 1132 return 583; |
| 1133 case CSSPropertyScrollSnapStop: |
| 1134 return 584; |
| 1087 // 1. Add new features above this line (don't change the assigned numbers of | 1135 // 1. Add new features above this line (don't change the assigned numbers of |
| 1088 // the existing items). | 1136 // the existing items). |
| 1089 // 2. Update kMaximumCSSSampleId with the new maximum value. | 1137 // 2. Update kMaximumCSSSampleId with the new maximum value. |
| 1090 // 3. Run the update_use_counter_css.py script in | 1138 // 3. Run the update_use_counter_css.py script in |
| 1091 // chromium/src/tools/metrics/histograms to update the UMA histogram names. | 1139 // chromium/src/tools/metrics/histograms to update the UMA histogram names. |
| 1092 | 1140 |
| 1093 case CSSPropertyInvalid: | 1141 case CSSPropertyInvalid: |
| 1094 NOTREACHED(); | 1142 NOTREACHED(); |
| 1095 return 0; | 1143 return 0; |
| 1096 } | 1144 } |
| (...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1431 } | 1479 } |
| 1432 } | 1480 } |
| 1433 | 1481 |
| 1434 if (needs_pages_measured_update) | 1482 if (needs_pages_measured_update) |
| 1435 css_properties_histogram.Count(totalPagesMeasuredCSSSampleId()); | 1483 css_properties_histogram.Count(totalPagesMeasuredCSSSampleId()); |
| 1436 | 1484 |
| 1437 css_bits_.ClearAll(); | 1485 css_bits_.ClearAll(); |
| 1438 } | 1486 } |
| 1439 | 1487 |
| 1440 } // namespace blink | 1488 } // namespace blink |
| OLD | NEW |