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 = 555; | 49 constexpr int kMaximumCSSSampleId = 556; |
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 cssPropertyID) { | 56 CSSPropertyID cssPropertyID) { |
57 switch (cssPropertyID) { | 57 switch (cssPropertyID) { |
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 1012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1072 case CSSPropertyBlockSize: | 1072 case CSSPropertyBlockSize: |
1073 return 551; | 1073 return 551; |
1074 case CSSPropertyMinInlineSize: | 1074 case CSSPropertyMinInlineSize: |
1075 return 552; | 1075 return 552; |
1076 case CSSPropertyMinBlockSize: | 1076 case CSSPropertyMinBlockSize: |
1077 return 553; | 1077 return 553; |
1078 case CSSPropertyMaxInlineSize: | 1078 case CSSPropertyMaxInlineSize: |
1079 return 554; | 1079 return 554; |
1080 case CSSPropertyMaxBlockSize: | 1080 case CSSPropertyMaxBlockSize: |
1081 return 555; | 1081 return 555; |
| 1082 case CSSPropertyAliasLineBreak: |
| 1083 return 556; |
1082 // 1. Add new features above this line (don't change the assigned numbers of | 1084 // 1. Add new features above this line (don't change the assigned numbers of |
1083 // the existing items). | 1085 // the existing items). |
1084 // 2. Update kMaximumCSSSampleId with the new maximum value. | 1086 // 2. Update kMaximumCSSSampleId with the new maximum value. |
1085 // 3. Run the update_use_counter_css.py script in | 1087 // 3. Run the update_use_counter_css.py script in |
1086 // chromium/src/tools/metrics/histograms to update the UMA histogram names. | 1088 // chromium/src/tools/metrics/histograms to update the UMA histogram names. |
1087 | 1089 |
1088 case CSSPropertyInvalid: | 1090 case CSSPropertyInvalid: |
1089 ASSERT_NOT_REACHED(); | 1091 ASSERT_NOT_REACHED(); |
1090 return 0; | 1092 return 0; |
1091 } | 1093 } |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1356 } | 1358 } |
1357 } | 1359 } |
1358 | 1360 |
1359 if (needsPagesMeasuredUpdate) | 1361 if (needsPagesMeasuredUpdate) |
1360 cssPropertiesHistogram.count(totalPagesMeasuredCSSSampleId()); | 1362 cssPropertiesHistogram.count(totalPagesMeasuredCSSSampleId()); |
1361 | 1363 |
1362 m_CSSBits.clearAll(); | 1364 m_CSSBits.clearAll(); |
1363 } | 1365 } |
1364 | 1366 |
1365 } // namespace blink | 1367 } // namespace blink |
OLD | NEW |