Destroying a window on long press doesn't crash.
commit579cfc3f1f5ac16ed4b76f211da559435aa65389
authortdresser@chromium.org <tdresser@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Mon, 7 Jul 2014 16:18:05 +0000 (7 16:18 +0000)
committertdresser@chromium.org <tdresser@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Mon, 7 Jul 2014 16:18:05 +0000 (7 16:18 +0000)
tree1eed0b0a300afa6a7d3aa6bc4e9d9acc5a3b2e97
parent2278c2c256ac816041b036212e98477c72f2a0ae
Destroying a window on long press doesn't crash.

The most obvious symptom of this issue is triggered by
https://code.google.com/p/chromium/codesearch#chromium/src/ash/drag_drop/drag_drop_controller.cc&l=227.

When you long press a bookmark, for example, a nested
message loop is created, while the gesture detector hasn't
finished processing the long press gesture. The window is
deleted within this nested message loop, which ends up
deleting the gesture detector.

This change ensures that the gesture detector doesn't
touch any local variables after dispatching events
triggered by timeouts.

BUG=391063
TEST=GestureRecognizerTest.GestureEventLongPressDeletingWindow
TBR=sadrul@chromium.org

Review URL: https://codereview.chromium.org/370013002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@281549 0039d316-1c4b-4281-b951-d872f2087c98
ui/aura/gestures/gesture_recognizer_unittest.cc
ui/events/gesture_detection/gesture_detector.cc
ui/events/gesture_detection/gesture_detector.h
ui/events/gesture_detection/gesture_provider.cc
ui/events/gesture_detection/touch_disposition_gesture_filter.cc
ui/events/gesture_detection/touch_disposition_gesture_filter.h