OLD | NEW |
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 #ifndef HitTestCache_h | 5 #ifndef HitTestCache_h |
6 #define HitTestCache_h | 6 #define HitTestCache_h |
7 | 7 |
8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
9 #include "core/layout/HitTestResult.h" | 9 #include "core/layout/HitTestResult.h" |
10 #include "platform/heap/Handle.h" | 10 #include "platform/heap/Handle.h" |
11 #include "wtf/Noncopyable.h" | 11 #include "platform/wtf/Noncopyable.h" |
12 #include "wtf/Vector.h" | 12 #include "platform/wtf/Vector.h" |
13 | 13 |
14 namespace blink { | 14 namespace blink { |
15 | 15 |
16 // This object implements a cache for storing successful hit tests to DOM nodes | 16 // This object implements a cache for storing successful hit tests to DOM nodes |
17 // in the visible viewport. The cache is cleared on dom modifications, | 17 // in the visible viewport. The cache is cleared on dom modifications, |
18 // scrolling, CSS style modifications. | 18 // scrolling, CSS style modifications. |
19 // | 19 // |
20 // Multiple hit tests can occur when processing events. Typically the DOM | 20 // Multiple hit tests can occur when processing events. Typically the DOM |
21 // doesn't change when each event is processed so in order to decrease the time | 21 // doesn't change when each event is processed so in order to decrease the time |
22 // spent processing the events a hit cache is useful. For example a GestureTap | 22 // spent processing the events a hit cache is useful. For example a GestureTap |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 }; | 72 }; |
73 | 73 |
74 unsigned update_index_; | 74 unsigned update_index_; |
75 HeapVector<HitTestResult, HIT_TEST_CACHE_SIZE> items_; | 75 HeapVector<HitTestResult, HIT_TEST_CACHE_SIZE> items_; |
76 uint64_t dom_tree_version_; | 76 uint64_t dom_tree_version_; |
77 }; | 77 }; |
78 | 78 |
79 } // namespace blink | 79 } // namespace blink |
80 | 80 |
81 #endif // HitTestCache_h | 81 #endif // HitTestCache_h |
OLD | NEW |