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

Unified Diff: third_party/WebKit/Source/core/layout/HitTestCache.cpp

Issue 1647883004: Support caching histograms so that a lookup isn't done in each iteration. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add explicit to protected ctor as well Created 4 years, 11 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
Index: third_party/WebKit/Source/core/layout/HitTestCache.cpp
diff --git a/third_party/WebKit/Source/core/layout/HitTestCache.cpp b/third_party/WebKit/Source/core/layout/HitTestCache.cpp
index c38df2b8c877b73fe215a4352b2c8c342c80d133..2039732706188aae194aa1cc0cb34f8cc4bbc030 100644
--- a/third_party/WebKit/Source/core/layout/HitTestCache.cpp
+++ b/third_party/WebKit/Source/core/layout/HitTestCache.cpp
@@ -4,6 +4,7 @@
#include "core/layout/HitTestCache.h"
+#include "platform/Histogram.h"
#include "public/platform/Platform.h"
namespace blink {
@@ -28,7 +29,8 @@ bool HitTestCache::lookupCachedResult(HitTestResult& hitResult, uint64_t domTree
}
}
}
- Platform::current()->histogramEnumeration("Event.HitTest", static_cast<int>(metric), static_cast<int>(HitHistogramMetric::MAX_HIT_METRIC));
+ DEFINE_STATIC_LOCAL(EnumerationHistogram, hitTestHistogram, ("Event.HitTest", static_cast<int32_t>(HitHistogramMetric::MAX_HIT_METRIC)));
+ hitTestHistogram.count(static_cast<int32_t>(metric));
return result;
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutView.cpp » ('j') | third_party/WebKit/Source/platform/Histogram.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698