diff options
author | wangxianzhu@chromium.org <wangxianzhu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-24 22:35:18 +0000 |
---|---|---|
committer | wangxianzhu@chromium.org <wangxianzhu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-24 22:35:18 +0000 |
commit | 3f82304b46e736274e1716f2cfb6e26ce4e2b209 (patch) | |
tree | d12f75432320e874d3dc4d1f4b60d604a6128350 /content/public/android | |
parent | ecbb97687dd14622163c5ab5861fc6f8392e35c6 (diff) | |
download | chromium_src-3f82304b46e736274e1716f2cfb6e26ce4e2b209.zip chromium_src-3f82304b46e736274e1716f2cfb6e26ce4e2b209.tar.gz chromium_src-3f82304b46e736274e1716f2cfb6e26ce4e2b209.tar.bz2 |
Fixed unpaired TraceEvent.begin()/end().
BUG=
Review URL: https://chromiumcodereview.appspot.com/11259003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@163932 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/public/android')
-rw-r--r-- | content/public/android/java/src/org/chromium/content/browser/ContentViewGestureHandler.java | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentViewGestureHandler.java b/content/public/android/java/src/org/chromium/content/browser/ContentViewGestureHandler.java index ba0d1dc..95e70c3 100644 --- a/content/public/android/java/src/org/chromium/content/browser/ContentViewGestureHandler.java +++ b/content/public/android/java/src/org/chromium/content/browser/ContentViewGestureHandler.java @@ -599,25 +599,28 @@ class ContentViewGestureHandler implements LongPressDelegate { * @return Whether the event was handled. */ boolean onTouchEvent(MotionEvent event) { - TraceEvent.begin("onTouchEvent"); - mLongPressDetector.cancelLongPressIfNeeded(event); - // Notify native that scrolling has stopped whenever a down action is processed prior to - // passing the event to native as it will drop them as an optimization if scrolling is - // enabled. Ending the fling ensures scrolling has stopped as well as terminating the - // current fling if applicable. - if (event.getActionMasked() == MotionEvent.ACTION_DOWN) { - endFling(event.getEventTime()); - } + try { + TraceEvent.begin("onTouchEvent"); + mLongPressDetector.cancelLongPressIfNeeded(event); + // Notify native that scrolling has stopped whenever a down action is processed prior to + // passing the event to native as it will drop them as an optimization if scrolling is + // enabled. Ending the fling ensures scrolling has stopped as well as terminating the + // current fling if applicable. + if (event.getActionMasked() == MotionEvent.ACTION_DOWN) { + endFling(event.getEventTime()); + } - if (offerTouchEventToJavaScript(event)) { - // offerTouchEventToJavaScript returns true to indicate the event was sent - // to the render process. If it is not subsequently handled, it will - // be returned via confirmTouchEvent(false) and eventually passed to - // processTouchEvent asynchronously. + if (offerTouchEventToJavaScript(event)) { + // offerTouchEventToJavaScript returns true to indicate the event was sent + // to the render process. If it is not subsequently handled, it will + // be returned via confirmTouchEvent(false) and eventually passed to + // processTouchEvent asynchronously. + return true; + } + return processTouchEvent(event); + } finally { TraceEvent.end("onTouchEvent"); - return true; } - return processTouchEvent(event); } /** |