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

Side by Side Diff: ui/events/gestures/gesture_recognizer_impl.cc

Issue 2869823003: [VSync Queue] Plug touch ack to gesture events and flush vsync queue if necessary (Closed)
Patch Set: Fix MSAN Use-of-uninitialized-value: Initialize GestureEventDetails Created 3 years, 6 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/gestures/gesture_recognizer_impl.h" 5 #include "ui/events/gestures/gesture_recognizer_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <limits> 9 #include <limits>
10 #include <memory> 10 #include <memory>
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 return false; 275 return false;
276 276
277 GestureProviderAura* gesture_provider = 277 GestureProviderAura* gesture_provider =
278 GetGestureProviderForConsumer(consumer); 278 GetGestureProviderForConsumer(consumer);
279 return gesture_provider->OnTouchEvent(event); 279 return gesture_provider->OnTouchEvent(event);
280 } 280 }
281 281
282 GestureRecognizer::Gestures GestureRecognizerImpl::AckTouchEvent( 282 GestureRecognizer::Gestures GestureRecognizerImpl::AckTouchEvent(
283 uint32_t unique_event_id, 283 uint32_t unique_event_id,
284 ui::EventResult result, 284 ui::EventResult result,
285 bool is_source_touch_event_set_non_blocking,
285 GestureConsumer* consumer) { 286 GestureConsumer* consumer) {
286 GestureProviderAura* gesture_provider = nullptr; 287 GestureProviderAura* gesture_provider = nullptr;
287 288
288 // Check if we have already processed this event before dispatch and have a 289 // Check if we have already processed this event before dispatch and have a
289 // consumer associated with it. 290 // consumer associated with it.
290 auto event_to_gesture_provider_iterator = 291 auto event_to_gesture_provider_iterator =
291 event_to_gesture_provider_.find(unique_event_id); 292 event_to_gesture_provider_.find(unique_event_id);
292 if (event_to_gesture_provider_iterator != event_to_gesture_provider_.end()) { 293 if (event_to_gesture_provider_iterator != event_to_gesture_provider_.end()) {
293 gesture_provider = event_to_gesture_provider_iterator->second; 294 gesture_provider = event_to_gesture_provider_iterator->second;
294 event_to_gesture_provider_.erase(event_to_gesture_provider_iterator); 295 event_to_gesture_provider_.erase(event_to_gesture_provider_iterator);
295 } else { 296 } else {
296 gesture_provider = GetGestureProviderForConsumer(consumer); 297 gesture_provider = GetGestureProviderForConsumer(consumer);
297 } 298 }
298 gesture_provider->OnTouchEventAck(unique_event_id, result != ER_UNHANDLED); 299 gesture_provider->OnTouchEventAck(unique_event_id, result != ER_UNHANDLED,
300 is_source_touch_event_set_non_blocking);
299 return gesture_provider->GetAndResetPendingGestures(); 301 return gesture_provider->GetAndResetPendingGestures();
300 } 302 }
301 303
302 bool GestureRecognizerImpl::CleanupStateForConsumer( 304 bool GestureRecognizerImpl::CleanupStateForConsumer(
303 GestureConsumer* consumer) { 305 GestureConsumer* consumer) {
304 bool state_cleaned_up = false; 306 bool state_cleaned_up = false;
305 307
306 auto consumer_gesture_provider_it = consumer_gesture_provider_.find(consumer); 308 auto consumer_gesture_provider_it = consumer_gesture_provider_.find(consumer);
307 if (consumer_gesture_provider_it != consumer_gesture_provider_.end()) { 309 if (consumer_gesture_provider_it != consumer_gesture_provider_.end()) {
308 // Remove gesture provider associated with the consumer from 310 // Remove gesture provider associated with the consumer from
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 std::vector<GestureEventHelper*>::iterator it; 373 std::vector<GestureEventHelper*>::iterator it;
372 for (it = helpers.begin(); it != helpers.end(); ++it) 374 for (it = helpers.begin(); it != helpers.end(); ++it)
373 gesture_recognizer->AddGestureEventHelper(*it); 375 gesture_recognizer->AddGestureEventHelper(*it);
374 376
375 helpers.clear(); 377 helpers.clear();
376 g_gesture_recognizer_instance = 378 g_gesture_recognizer_instance =
377 static_cast<GestureRecognizerImpl*>(gesture_recognizer); 379 static_cast<GestureRecognizerImpl*>(gesture_recognizer);
378 } 380 }
379 381
380 } // namespace ui 382 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698