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

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

Issue 400213002: Refcount touch tracking ids to prevent freeing them too early. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use ui::TouchEvents in test. Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « ui/events/cocoa/events_mac.mm ('k') | ui/events/event_utils.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/extensions/XInput2.h> 8 #include <X11/extensions/XInput2.h>
9 #include <X11/Xlib.h> 9 #include <X11/Xlib.h>
10 #endif 10 #endif
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 rotation_angle_(GetTouchAngle(native_event)), 474 rotation_angle_(GetTouchAngle(native_event)),
475 force_(GetTouchForce(native_event)) { 475 force_(GetTouchForce(native_event)) {
476 latency()->AddLatencyNumberWithTimestamp( 476 latency()->AddLatencyNumberWithTimestamp(
477 INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, 477 INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT,
478 0, 478 0,
479 0, 479 0,
480 base::TimeTicks::FromInternalValue(time_stamp().ToInternalValue()), 480 base::TimeTicks::FromInternalValue(time_stamp().ToInternalValue()),
481 1); 481 1);
482 482
483 latency()->AddLatencyNumber(INPUT_EVENT_LATENCY_UI_COMPONENT, 0, 0); 483 latency()->AddLatencyNumber(INPUT_EVENT_LATENCY_UI_COMPONENT, 0, 0);
484
485 if (type() == ET_TOUCH_PRESSED)
486 IncrementTouchIdRefCount(native_event);
484 } 487 }
485 488
486 TouchEvent::TouchEvent(EventType type, 489 TouchEvent::TouchEvent(EventType type,
487 const gfx::PointF& location, 490 const gfx::PointF& location,
488 int touch_id, 491 int touch_id,
489 base::TimeDelta time_stamp) 492 base::TimeDelta time_stamp)
490 : LocatedEvent(type, location, location, time_stamp, 0), 493 : LocatedEvent(type, location, location, time_stamp, 0),
491 touch_id_(touch_id), 494 touch_id_(touch_id),
492 radius_x_(0.0f), 495 radius_x_(0.0f),
493 radius_y_(0.0f), 496 radius_y_(0.0f),
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
782 gfx::PointF(x, y), 785 gfx::PointF(x, y),
783 time_stamp, 786 time_stamp,
784 flags | EF_FROM_TOUCH), 787 flags | EF_FROM_TOUCH),
785 details_(details) { 788 details_(details) {
786 } 789 }
787 790
788 GestureEvent::~GestureEvent() { 791 GestureEvent::~GestureEvent() {
789 } 792 }
790 793
791 } // namespace ui 794 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/cocoa/events_mac.mm ('k') | ui/events/event_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698