Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Unified Diff: third_party/WebKit/Source/core/frame/UseCounter.cpp

Issue 2368103003: Adjust CSS property maximum tracking to be more clang-format friendly. (Closed)
Patch Set: Remove parens Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/frame/PRESUBMIT.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/frame/UseCounter.cpp
diff --git a/third_party/WebKit/Source/core/frame/UseCounter.cpp b/third_party/WebKit/Source/core/frame/UseCounter.cpp
index 914424a035b9ea29bc641452f3aab0e6cf10965e..e3e2de8e6f5c824b278ace6428042ae63ff79900 100644
--- a/third_party/WebKit/Source/core/frame/UseCounter.cpp
+++ b/third_party/WebKit/Source/core/frame/UseCounter.cpp
@@ -43,7 +43,7 @@ namespace {
int totalPagesMeasuredCSSSampleId() { return 1; }
// Make sure update_use_counter_css.py was run which updates histograms.xml.
-int maximumCSSSampleId() { return 545; }
+constexpr int kMaximumCSSSampleId = 545;
} // namespace
@@ -579,7 +579,7 @@ int UseCounter::mapCSSPropertyIdToCSSSampleIdForHistogram(CSSPropertyID cssPrope
case CSSPropertyOffsetPosition: return 545;
// 1. Add new features above this line (don't change the assigned numbers of the existing
// items).
- // 2. Update maximumCSSSampleId() with the new maximum value.
+ // 2. Update kMaximumCSSSampleId with the new maximum value.
// 3. Run the update_use_counter_css.py script in
// chromium/src/tools/metrics/histograms to update the UMA histogram names.
@@ -795,8 +795,8 @@ EnumerationHistogram& UseCounter::featuresHistogram() const
EnumerationHistogram& UseCounter::cssHistogram() const
{
- DEFINE_STATIC_LOCAL(blink::EnumerationHistogram, histogram, ("WebCore.UseCounter_TEST.CSSProperties", maximumCSSSampleId()));
- DEFINE_STATIC_LOCAL(blink::EnumerationHistogram, svgHistogram, ("WebCore.UseCounter_TEST.SVGImage.CSSProperties", maximumCSSSampleId()));
+ DEFINE_STATIC_LOCAL(blink::EnumerationHistogram, histogram, ("WebCore.UseCounter_TEST.CSSProperties", kMaximumCSSSampleId));
+ DEFINE_STATIC_LOCAL(blink::EnumerationHistogram, svgHistogram, ("WebCore.UseCounter_TEST.SVGImage.CSSProperties", kMaximumCSSSampleId));
return m_context == SVGImageContext ? svgHistogram : histogram;
}
@@ -851,7 +851,7 @@ void UseCounter::LegacyCounter::updateMeasurements()
// FIXME: Sometimes this function is called more than once per page. The following
// bool guards against incrementing the page count when there are no CSS
// bits set. https://crbug.com/236262.
- DEFINE_STATIC_LOCAL(EnumerationHistogram, cssPropertiesHistogram, ("WebCore.FeatureObserver.CSSProperties", maximumCSSSampleId()));
+ DEFINE_STATIC_LOCAL(EnumerationHistogram, cssPropertiesHistogram, ("WebCore.FeatureObserver.CSSProperties", kMaximumCSSSampleId));
bool needsPagesMeasuredUpdate = false;
for (size_t i = firstCSSProperty; i <= lastUnresolvedCSSProperty; ++i) {
if (m_CSSBits.quickGet(i)) {
« no previous file with comments | « third_party/WebKit/Source/core/frame/PRESUBMIT.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698