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.

This commit is contained in:
Grace Kloba
2009-07-17 20:39:25 -07:00
parent fd7628aa84
commit fadbbd2a0c

View File

@@ -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