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

Unified Diff: ui/events/gesture_detection/bitset_32.h

Issue 586553002: Allow repeated handler removal/addition with the TouchEventQueue (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 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 | « content/browser/renderer_host/render_widget_host_view_aura_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/gesture_detection/bitset_32.h
diff --git a/ui/events/gesture_detection/bitset_32.h b/ui/events/gesture_detection/bitset_32.h
index 9cb9d48aee65fd3f03c24eb6a624d390dcb581aa..1cc2dadca65cfdee2b74fe3e890d275ba027c170 100644
--- a/ui/events/gesture_detection/bitset_32.h
+++ b/ui/events/gesture_detection/bitset_32.h
@@ -6,6 +6,7 @@
#define UI_EVENTS_GESTURE_DETECTION_BITSET_32_H_
#include "base/basictypes.h"
+#include "base/logging.h"
namespace ui {
@@ -20,7 +21,10 @@ struct BitSet32 {
explicit inline BitSet32(uint32_t value) : value(value) {}
// Gets the value associated with a particular bit index.
- static inline uint32_t value_for_bit(uint32_t n) { return 0x80000000 >> n; }
+ static inline uint32_t value_for_bit(uint32_t n) {
+ DCHECK_LE(n, 31U);
+ return 0x80000000 >> n;
+ }
// Clears the bit set.
inline void clear() { value = 0; }
@@ -86,6 +90,7 @@ struct BitSet32 {
// Gets the inde of the specified bit in the set, which is the number of
// marked bits that appear before the specified bit.
inline uint32_t get_index_of_bit(uint32_t n) const {
+ DCHECK_LE(n, 31U);
return popcnt(value & ~(0xffffffffUL >> n));
}
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_aura_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698