Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fadbbd2a authored by Grace Kloba's avatar Grace Kloba
Browse files

Fix 1986313. WebKit assumes things happened in a certain order. In this case,...

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.
parent fd7628aa
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -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