summaryrefslogtreecommitdiffstats
path: root/core/java/android/webkit/WebView.java
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2011-01-30 16:23:09 -0800
committerJohn Reck <jreck@google.com>2011-01-30 16:23:09 -0800
commit636ce004df692d609c6ec9bef63ca8837fd95dc9 (patch)
tree8099dc83175783a47c7feabd2bdd6e45d93528c0 /core/java/android/webkit/WebView.java
parent3c89f6d1bd0821d0ae0205a5b48176156735aaac (diff)
downloadframeworks_base-636ce004df692d609c6ec9bef63ca8837fd95dc9.zip
frameworks_base-636ce004df692d609c6ec9bef63ca8837fd95dc9.tar.gz
frameworks_base-636ce004df692d609c6ec9bef63ca8837fd95dc9.tar.bz2
Prevent SET_SCROLL_OFFSET spam from clogging tubes
Bug: 3393571 Limit the event queue to a single pending SET_SCROLL_OFFSET. The problem on slashdot.org was that the event thread was being flooded with SET_SCROLL_OFFSET messages faster than it could process them, causing the handler to get jammed up. Change-Id: Ia4a90a030959d0b3769067791089cdb261ae403a
Diffstat (limited to 'core/java/android/webkit/WebView.java')
-rw-r--r--core/java/android/webkit/WebView.java1
1 files changed, 1 insertions, 0 deletions
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index 790a040..a9abb65 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -2506,6 +2506,7 @@ public class WebView extends AbsoluteLayout
// Rect.equals() checks for null input.
if (!rect.equals(mLastVisibleRectSent)) {
Point pos = new Point(rect.left, rect.top);
+ mWebViewCore.removeMessages(EventHub.SET_SCROLL_OFFSET);
mWebViewCore.sendMessage(EventHub.SET_SCROLL_OFFSET,
nativeMoveGeneration(), mUserScroll ? 1 : 0, pos);
mLastVisibleRectSent = rect;