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

Side by Side Diff: Source/core/layout/HitTestCache.cpp

Issue 1211973004: Add another uma metric for HitTesting validity. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | Source/core/layout/HitTestResult.h » ('j') | Source/core/layout/HitTestResult.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "core/layout/HitTestCache.h" 6 #include "core/layout/HitTestCache.h"
7 7
8 #include "public/platform/Platform.h" 8 #include "public/platform/Platform.h"
9 9
10 namespace blink { 10 namespace blink {
(...skipping 20 matching lines...) Expand all
31 } 31 }
32 Platform::current()->histogramEnumeration("Event.HitTest", static_cast<int>( metric), static_cast<int>(HitHistogramMetric::MAX_HIT_METRIC)); 32 Platform::current()->histogramEnumeration("Event.HitTest", static_cast<int>( metric), static_cast<int>(HitHistogramMetric::MAX_HIT_METRIC));
33 return result; 33 return result;
34 } 34 }
35 35
36 void HitTestCache::verifyCachedResult(const HitTestResult& expected, const HitTe stResult& actual) 36 void HitTestCache::verifyCachedResult(const HitTestResult& expected, const HitTe stResult& actual)
37 { 37 {
38 ValidityHistogramMetric metric; 38 ValidityHistogramMetric metric;
39 if (!actual.equalForCacheability(expected)) { 39 if (!actual.equalForCacheability(expected)) {
40 metric = expected.hitTestLocation().isRectBasedTest() ? ValidityHistogra mMetric::INCORRECT_RECT_BASED_EXACT_MATCH : ValidityHistogramMetric::INCORRECT_P OINT_EXACT_MATCH; 40 metric = expected.hitTestLocation().isRectBasedTest() ? ValidityHistogra mMetric::INCORRECT_RECT_BASED_EXACT_MATCH : ValidityHistogramMetric::INCORRECT_P OINT_EXACT_MATCH;
41 Platform::current()->histogramSparse("Event.HitTestValidityScore", stati c_cast<int>(actual.equalityScore(expected)));
41 42
42 // ASSERT that the cache hit is the same as the actual result. 43 // ASSERT that the cache hit is the same as the actual result.
43 ASSERT_NOT_REACHED(); 44 ASSERT_NOT_REACHED();
44 } else { 45 } else {
45 metric = ValidityHistogramMetric::VALID_EXACT_MATCH; 46 metric = ValidityHistogramMetric::VALID_EXACT_MATCH;
46 } 47 }
47 Platform::current()->histogramEnumeration("Event.HitTestValidity", static_ca st<int>(metric), static_cast<int>(ValidityHistogramMetric::MAX_VALIDITY_METRIC)) ; 48 Platform::current()->histogramEnumeration("Event.HitTestValidity", static_ca st<int>(metric), static_cast<int>(ValidityHistogramMetric::MAX_VALIDITY_METRIC)) ;
48 } 49 }
49 50
50 void HitTestCache::addCachedResult(const HitTestResult& result, uint64_t domTree Version) 51 void HitTestCache::addCachedResult(const HitTestResult& result, uint64_t domTree Version)
(...skipping 27 matching lines...) Expand all
78 m_updateIndex = 0; 79 m_updateIndex = 0;
79 m_items.clear(); 80 m_items.clear();
80 } 81 }
81 82
82 DEFINE_TRACE(HitTestCache) 83 DEFINE_TRACE(HitTestCache)
83 { 84 {
84 visitor->trace(m_items); 85 visitor->trace(m_items);
85 } 86 }
86 87
87 } // namespace blink 88 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/core/layout/HitTestResult.h » ('j') | Source/core/layout/HitTestResult.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698