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

Side by Side Diff: ui/events/event.cc

Issue 25022003: Report LatencyInfo through trace buffer (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: address sadrul's comments Created 7 years, 2 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/events/event.h" 5 #include "ui/events/event.h"
6 6
7 #if defined(USE_X11) 7 #if defined(USE_X11)
8 #include <X11/Xlib.h> 8 #include <X11/Xlib.h>
9 #endif 9 #endif
10 10
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 void Event::InitWithNativeEvent(const base::NativeEvent& native_event) { 234 void Event::InitWithNativeEvent(const base::NativeEvent& native_event) {
235 native_event_ = native_event; 235 native_event_ = native_event;
236 } 236 }
237 237
238 void Event::InitLatencyInfo() { 238 void Event::InitLatencyInfo() {
239 latency_.AddLatencyNumberWithTimestamp(INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, 239 latency_.AddLatencyNumberWithTimestamp(INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT,
240 0, 240 0,
241 0, 241 0,
242 base::TimeTicks::FromInternalValue( 242 base::TimeTicks::FromInternalValue(
243 time_stamp_.ToInternalValue()), 243 time_stamp_.ToInternalValue()),
244 1); 244 1,
245 true);
245 latency_.AddLatencyNumber(INPUT_EVENT_LATENCY_UI_COMPONENT, 0, 0); 246 latency_.AddLatencyNumber(INPUT_EVENT_LATENCY_UI_COMPONENT, 0, 0);
246 } 247 }
247 248
248 //////////////////////////////////////////////////////////////////////////////// 249 ////////////////////////////////////////////////////////////////////////////////
249 // CancelModeEvent 250 // CancelModeEvent
250 251
251 CancelModeEvent::CancelModeEvent() 252 CancelModeEvent::CancelModeEvent()
252 : Event(ET_CANCEL_MODE, base::TimeDelta(), 0) { 253 : Event(ET_CANCEL_MODE, base::TimeDelta(), 0) {
253 set_cancelable(false); 254 set_cancelable(false);
254 } 255 }
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after
762 int GestureEvent::GetLowestTouchId() const { 763 int GestureEvent::GetLowestTouchId() const {
763 if (touch_ids_bitfield_ == 0) 764 if (touch_ids_bitfield_ == 0)
764 return -1; 765 return -1;
765 int i = -1; 766 int i = -1;
766 // Find the index of the least significant 1 bit 767 // Find the index of the least significant 1 bit
767 while (!(1 << ++i & touch_ids_bitfield_)); 768 while (!(1 << ++i & touch_ids_bitfield_));
768 return i; 769 return i;
769 } 770 }
770 771
771 } // namespace ui 772 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698