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

Commit 4d492346 authored by Steve Block's avatar Steve Block Committed by Android (Google) Code Review
Browse files

Merge "Fixes synchronous XHR requests which require authentication to complete synchronously"

parents 3949c609 c76bfa5b
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -200,7 +200,7 @@ public class RequestHandle {
                if (mBodyProvider != null) mBodyProvider.reset();
            } catch (java.io.IOException ex) {
                if (HttpLog.LOGV) {
                    HttpLog.v("setupAuthResponse() failed to reset body provider");
                    HttpLog.v("setupRedirect() failed to reset body provider");
                }
                return false;
            }
@@ -443,6 +443,16 @@ public class RequestHandle {
     * Creates and queues new request.
     */
    private void createAndQueueNewRequest() {
        // mConnection is non-null if and only if the requests are synchronous.
        if (mConnection != null) {
            RequestHandle newHandle = mRequestQueue.queueSynchronousRequest(
                    mUrl, mUri, mMethod, mHeaders, mRequest.mEventHandler,
                    mBodyProvider, mBodyLength);
            mRequest = newHandle.mRequest;
            mConnection = newHandle.mConnection;
            newHandle.processRequest();
            return;
        }
        mRequest = mRequestQueue.queueRequest(
                mUrl, mUri, mMethod, mHeaders, mRequest.mEventHandler,
                mBodyProvider,
+1 −1
Original line number Diff line number Diff line
@@ -1599,7 +1599,7 @@ class LoadListener extends Handler implements EventHandler {
        // from http thread. Then it is called again from WebViewCore thread 
        // after the load is completed. So make sure the queue is cleared but
        // don't set it to null.
        for (int size = mMessageQueue.size(); size > 0; size--) {
        while (!mMessageQueue.isEmpty()) {
            handleMessage(mMessageQueue.remove(0));
        }
    }