Roll src/third_party/WebKit 7f556d1:d75145d (svn 195932:195940)
[chromium-blink-merge.git] / ui / events / base_event_utils.cc
blob313a37cb15c876f5d51d4eee920c3ced806182b5
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "ui/events/base_event_utils.h"
7 #include "base/atomic_sequence_num.h"
8 #include "base/logging.h"
10 namespace ui {
12 base::StaticAtomicSequenceNumber g_next_event_id;
14 uint32 GetNextTouchEventId() {
15 // Set the first touch event ID to 1 because we set id to 0 for other types
16 // of events.
17 uint32 id = g_next_event_id.GetNext();
18 if (id == 0)
19 id = g_next_event_id.GetNext();
20 DCHECK_NE(0U, id);
21 return id;
24 } // namespace ui