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

Unified Diff: content/browser/android/content_view_core_impl.cc

Issue 170673005: [Android] More eager gesture recognition hardening (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add type DCHECK Created 6 years, 10 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 | « no previous file | content/browser/renderer_host/input/gesture_event_packet.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/android/content_view_core_impl.cc
diff --git a/content/browser/android/content_view_core_impl.cc b/content/browser/android/content_view_core_impl.cc
index 382db082ec38eaec66f344b737c010195ad0ca3a..fcb5478243d5c5bf9b355566212f6e8f027f5ae0 100644
--- a/content/browser/android/content_view_core_impl.cc
+++ b/content/browser/android/content_view_core_impl.cc
@@ -1030,7 +1030,12 @@ void ContentViewCoreImpl::OnTouchEventHandlingBegin(JNIEnv* env,
}
void ContentViewCoreImpl::OnTouchEventHandlingEnd(JNIEnv* env, jobject obj) {
- DCHECK(handling_touch_event_);
+ if (!handling_touch_event_)
+ return;
+
+ GestureEventPacket gesture_packet;
+ std::swap(gesture_packet, pending_gesture_packet_);
+
handling_touch_event_ = false;
RenderWidgetHostViewAndroid* rwhv = GetRenderWidgetHostViewAndroid();
@@ -1039,8 +1044,7 @@ void ContentViewCoreImpl::OnTouchEventHandlingEnd(JNIEnv* env, jobject obj) {
// Note: Order is important here, as the touch may be ack'ed synchronously
TouchDispositionGestureFilter::PacketResult result =
- touch_disposition_gesture_filter_.OnGestureEventPacket(
- pending_gesture_packet_);
+ touch_disposition_gesture_filter_.OnGestureEventPacket(gesture_packet);
if (result != TouchDispositionGestureFilter::SUCCESS) {
NOTREACHED() << "Invalid touch gesture sequence detected.";
return;
« no previous file with comments | « no previous file | content/browser/renderer_host/input/gesture_event_packet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698