From fadbbd2a0cc94e5da4dea1ec3dac337e274c77c9 Mon Sep 17 00:00:00 2001 From: Grace Kloba Date: Fri, 17 Jul 2009 20:39:25 -0700 Subject: Fix 1986313. WebKit assumes things happened in a certain order. In this case, we can't call LoadListener's nativeError until BrowserFrame's startLoadingResource returns. Otherwise, the failed request will not be removed from the DocLoader's request list. So the page will never finish loading. --- core/java/android/webkit/BrowserFrame.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core/java/android/webkit/BrowserFrame.java b/core/java/android/webkit/BrowserFrame.java index 5a7a233c14fa..e6ccd70ab74c 100644 --- a/core/java/android/webkit/BrowserFrame.java +++ b/core/java/android/webkit/BrowserFrame.java @@ -550,12 +550,14 @@ class BrowserFrame extends Handler { mCallbackProxy.onLoadResource(url); if (LoadListener.getNativeLoaderCount() > MAX_OUTSTANDING_REQUESTS) { + // send an error message, so that loadListener can be deleted + // after this is returned. This is important as LoadListener's + // nativeError will remove the request from its DocLoader's request + // list. But the set up is not done until this method is returned. loadListener.error( android.net.http.EventHandler.ERROR, mContext.getString( com.android.internal.R.string.httpErrorTooManyRequests)); - loadListener.notifyError(); - loadListener.tearDown(); - return null; + return loadListener; } // during synchronous load, the WebViewCore thread is blocked, so we -- cgit v1.2.3-59-g8ed1b