Align XMLHttpRequest's open() / send() / abort() with the latest specification
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Mar 2018 04:16:26 +0000 (04:16 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Mar 2018 04:16:26 +0000 (04:16 +0000)
https://bugs.webkit.org/show_bug.cgi?id=184108

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

* web-platform-tests/XMLHttpRequest/abort-after-send-expected.txt:
* web-platform-tests/XMLHttpRequest/abort-during-open-expected.txt:
* web-platform-tests/XMLHttpRequest/abort-during-open.worker-expected.txt:
* web-platform-tests/XMLHttpRequest/abort-event-abort-expected.txt:
* web-platform-tests/XMLHttpRequest/abort-event-order-expected.txt:
* web-platform-tests/XMLHttpRequest/open-during-abort-event-expected.txt:
* web-platform-tests/XMLHttpRequest/open-during-abort-expected.txt:
* web-platform-tests/XMLHttpRequest/open-send-during-abort-expected.txt:
* web-platform-tests/XMLHttpRequest/security-consideration.sub-expected.txt:
* web-platform-tests/XMLHttpRequest/send-data-unexpected-tostring-expected.txt:
Rebaseline WPT tests that are now passing.

* web-platform-tests/XMLHttpRequest/open-during-abort-processing-expected.txt:
We now fail the test differently. Our results are consistent with Firefox. I believe this
test does not match the specification so I filed:
https://github.com/w3c/web-platform-tests/issues/10217

Source/WebCore:

Align XMLHttpRequest's open() / send() / abort() with the latest specification:
- https://xhr.spec.whatwg.org

No new tests, rebaselined existing layout tests.

* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::open):
Align with https://xhr.spec.whatwg.org/#the-open()-method:
- Change the order of some steps to match the order in the spec. In particular,
  open() no longer resets the state to UNSENT or abort any existing load when it
  fails early due to being passed a bad method.

(WebCore::XMLHttpRequest::createRequest):
Align with https://xhr.spec.whatwg.org/#the-send()-method:
- Use the simpler "upload listener flag" logic from the spec instead of our more
  complex m_uploadEventsAllowed flag. This avoids constructing a SecurityOrigin
  objects on a background thread when XHR is used inside Web Workers, which was
  not thread-safe.
- Set the upload complete flag when the request has no body as per step 9.
- After firing the loadstartEvent, return early if the state is no longer OPEN or
  if the send flag is unset, as per step 11.3.

(WebCore::XMLHttpRequest::abort):
Align with https://xhr.spec.whatwg.org/#the-abort()-method:
- Only set the state to UNSENT if the state is still DONE after firing the error
  events, as per step 3.

(WebCore::XMLHttpRequest::didSendData):
Use new "upload listener flag".

(WebCore::XMLHttpRequest::dispatchErrorEvents):
Align with https://xhr.spec.whatwg.org/#request-error-steps:
- Stop firing a progress event in case of error as this is not as per specification
  and Firefox does not fire those either.

* xml/XMLHttpRequest.h:

LayoutTests:

* http/tests/xmlhttprequest/onloadend-event-after-abort.html:
* http/tests/xmlhttprequest/onloadend-event-after-error.html:
* http/tests/xmlhttprequest/simple-cross-origin-progress-events-expected.txt:
* http/tests/xmlhttprequest/upload-onloadend-event-after-abort.html:
* http/tests/xmlhttprequest/xmlhttprequest-sync-no-progress-events-expected.txt:
Fix tests that expected a progress event before error/abort event. This is not as
per specification and those tests were also failing in Firefox.

* http/tests/xmlhttprequest/readystatechange-and-abort.html:
Fix test that expected abort() to reset state to UNSENT as this is not as per specification.
This test was failing in both Firefox and Chrome.

* http/tests/xmlhttprequest/xmlhttprequest-abort-readyState-shouldNotDispatchEvent.html:
Re-sync test from Blink. The test was wrongly expecting abort() to reset the state to
UNSENT.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230066 268f45cc-cd09-0410-ab3c-d52691b4dbfc

24 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/xmlhttprequest/onloadend-event-after-abort.html
LayoutTests/http/tests/xmlhttprequest/onloadend-event-after-error.html
LayoutTests/http/tests/xmlhttprequest/readystatechange-and-abort.html
LayoutTests/http/tests/xmlhttprequest/simple-cross-origin-progress-events-expected.txt
LayoutTests/http/tests/xmlhttprequest/upload-onloadend-event-after-abort.html
LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-abort-readyState-shouldNotDispatchEvent.html
LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-sync-no-progress-events-expected.txt
LayoutTests/imported/blink/http/tests/xmlhttprequest/resources/get.txt [new file with mode: 0644]
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/abort-after-send-expected.txt
LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/abort-during-open-expected.txt
LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/abort-during-open.worker-expected.txt
LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/abort-event-abort-expected.txt
LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/abort-event-order-expected.txt
LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-during-abort-event-expected.txt
LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-during-abort-expected.txt
LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-during-abort-processing-expected.txt
LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/open-send-during-abort-expected.txt
LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/security-consideration.sub-expected.txt
LayoutTests/imported/w3c/web-platform-tests/XMLHttpRequest/send-data-unexpected-tostring-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/xml/XMLHttpRequest.cpp
Source/WebCore/xml/XMLHttpRequest.h

index d051557..c51f5e2 100644 (file)
@@ -1,3 +1,26 @@
+2018-03-28  Chris Dumez  <cdumez@apple.com>
+
+        Align XMLHttpRequest's open() / send() / abort() with the latest specification
+        https://bugs.webkit.org/show_bug.cgi?id=184108
+
+        Reviewed by Youenn Fablet.
+
+        * http/tests/xmlhttprequest/onloadend-event-after-abort.html:
+        * http/tests/xmlhttprequest/onloadend-event-after-error.html:
+        * http/tests/xmlhttprequest/simple-cross-origin-progress-events-expected.txt:
+        * http/tests/xmlhttprequest/upload-onloadend-event-after-abort.html:
+        * http/tests/xmlhttprequest/xmlhttprequest-sync-no-progress-events-expected.txt:
+        Fix tests that expected a progress event before error/abort event. This is not as
+        per specification and those tests were also failing in Firefox.
+
+        * http/tests/xmlhttprequest/readystatechange-and-abort.html:
+        Fix test that expected abort() to reset state to UNSENT as this is not as per specification.
+        This test was failing in both Firefox and Chrome.
+
+        * http/tests/xmlhttprequest/xmlhttprequest-abort-readyState-shouldNotDispatchEvent.html:
+        Re-sync test from Blink. The test was wrongly expecting abort() to reset the state to
+        UNSENT.
+
 2018-03-28  Timothy Hatcher  <timothy@apple.com>
 
         Consolidate NSColor to WebCore::Color conversion and fix system colors.
index 6b9c750..7b65aab 100644 (file)
@@ -22,7 +22,7 @@ function log(message)
 
 var xhr = new XMLHttpRequest();
 var results = "";
-var expected = " loadstart readyState=DONE progress abort loadend";
+var expected = " loadstart readyState=DONE abort loadend";
 
 function logProgressEvent(e) {
     results += " " + e.type;
index 569b10e..05b36e0 100644 (file)
@@ -22,7 +22,7 @@ function log(message)
 
 var xhr = new XMLHttpRequest();
 var results = "";
-var expected = " loadstart readyState=DONE progress error loadend";
+var expected = " loadstart readyState=DONE error loadend";
 
 
 function logProgressEvent(e) {
index 387724c..fbb316d 100644 (file)
@@ -36,7 +36,7 @@ test(function()
     });
     xhr.open("GET", "resources/test.ogv", true);
     xhr.abort();
-    assert_equals(xhr.readyState, xhr.UNSENT, "xhr.readyState after abort() call");
+    assert_equals(xhr.readyState, xhr.OPENED, "xhr.readyState after abort() call");
     assert_array_equals(seenStates, [xhr.OPENED]);
 }, "Test onreadystatechange invocation when abort()-ed in OPENED state.");
 
index 2bf5138..ab4a627 100644 (file)
@@ -9,15 +9,12 @@ onload
 Response length: 8388608
 
 Test 2: The URL is not allowed for cross-origin requests
-onprogress
 onerror (expected)
 Response length: 0
 
 Test 3: The URL is not allowed for cross-origin requests and at least one upload event is listened for before doing the send.
 upload.onloadstart
-upload.onprogress
 upload.onerror (expected)
-onprogress
 onerror (expected)
 Response length: 0
 
index 77b9e8c..39033f1 100644 (file)
@@ -21,7 +21,7 @@ function log(message)
 
 var xhr = new XMLHttpRequest();
 var results = "";
-var expected = " progress abort loadend";
+var expected = " abort loadend";
 
 function logProgressEvent(e) {
     results += " " + e.type;
index ff4b711..d753930 100644 (file)
@@ -37,12 +37,20 @@ function testAbortDoNotDispatchEvent(num)
             ++finishedTests;
             this.onreadystatechange = catchReadystateEventAbort;
             this.abort();
-            if (this.readyState == 0)
+            // Following https://github.com/whatwg/xhr/issues/54, abort() should
+            // set readyState to UNSENT only when it (readyState) is DONE.
+            var pass;
+            if (num == XMLHttpRequest.DONE)
+                pass = this.readyState == XMLHttpRequest.UNSENT;
+            else
+                pass = this.readyState == num;
+
+            if (pass)
                 log("PASS");
             else
                 log("FAILED");
         }
-        
+
         if (finishedTests == abortToDo.length && window.testRunner)
             testRunner.notifyDone();
     }
diff --git a/LayoutTests/imported/blink/http/tests/xmlhttprequest/resources/get.txt b/LayoutTests/imported/blink/http/tests/xmlhttprequest/resources/get.txt
new file mode 100644 (file)
index 0000000..465701e
--- /dev/null
@@ -0,0 +1 @@
+PASS
\ No newline at end of file
index 3f483ee..32b36ee 100644 (file)
@@ -1,3 +1,27 @@
+2018-03-28  Chris Dumez  <cdumez@apple.com>
+
+        Align XMLHttpRequest's open() / send() / abort() with the latest specification
+        https://bugs.webkit.org/show_bug.cgi?id=184108
+
+        Reviewed by Youenn Fablet.
+
+        * web-platform-tests/XMLHttpRequest/abort-after-send-expected.txt:
+        * web-platform-tests/XMLHttpRequest/abort-during-open-expected.txt:
+        * web-platform-tests/XMLHttpRequest/abort-during-open.worker-expected.txt:
+        * web-platform-tests/XMLHttpRequest/abort-event-abort-expected.txt:
+        * web-platform-tests/XMLHttpRequest/abort-event-order-expected.txt:
+        * web-platform-tests/XMLHttpRequest/open-during-abort-event-expected.txt:
+        * web-platform-tests/XMLHttpRequest/open-during-abort-expected.txt:
+        * web-platform-tests/XMLHttpRequest/open-send-during-abort-expected.txt:
+        * web-platform-tests/XMLHttpRequest/security-consideration.sub-expected.txt:
+        * web-platform-tests/XMLHttpRequest/send-data-unexpected-tostring-expected.txt:
+        Rebaseline WPT tests that are now passing.
+
+        * web-platform-tests/XMLHttpRequest/open-during-abort-processing-expected.txt:
+        We now fail the test differently. Our results are consistent with Firefox. I believe this
+        test does not match the specification so I filed:
+        https://github.com/w3c/web-platform-tests/issues/10217
+
 2018-03-28  Ryan Haddad  <ryanhaddad@apple.com>
 
         Unreviewed, rolling out r230033.
index 9f48b94..7a4c1a5 100644 (file)
@@ -1,3 +1,3 @@
 
-FAIL XMLHttpRequest: The abort() method: do not fire abort event in OPENED state when send() flag is unset. assert_equals: abort() cannot change readyState when readyState is 1 and send() flag is unset expected 1 but got 0
+PASS XMLHttpRequest: The abort() method: do not fire abort event in OPENED state when send() flag is unset. 
 
index 8684c56..a01c33f 100644 (file)
@@ -1,3 +1,3 @@
 
-FAIL XMLHttpRequest: The abort() method: abort and loadend events assert_equals: expected "upload.abort(0,0,false)" but got "upload.progress(0,0,false)"
+PASS XMLHttpRequest: The abort() method: abort and loadend events 
 
index b297102..b977f03 100644 (file)
@@ -1,3 +1,3 @@
 
-FAIL XMLHttpRequest: open() during abort event - abort() called from upload.onloadstart assert_array_equals: property 5, expected "readyState after abort() 1" but got "readyState after abort() 0"
+PASS XMLHttpRequest: open() during abort event - abort() called from upload.onloadstart 
 
index 15f419d..9192154 100644 (file)
@@ -1,3 +1,3 @@
 
-FAIL XMLHttpRequest: open() during abort processing - abort() called from onloadstart assert_array_equals: property 7, expected "readyState after abort() 1" but got "readyState after abort() 0"
+FAIL XMLHttpRequest: open() during abort processing - abort() called from onloadstart assert_array_equals: lengths differ, expected 9 got 7
 
index 6873947..cae2145 100644 (file)
@@ -1,5 +1,5 @@
 CONSOLE MESSAGE: Origin http://localhost:8800 is not allowed by Access-Control-Allow-Origin.
 CONSOLE MESSAGE: XMLHttpRequest cannot load http://localhost:8801/XMLHttpRequest/resources/img.jpg due to access control checks.
 
-FAIL ProgressEvent: security consideration assert_unreached: MUST NOT dispatch progress event. Reached unreachable code
+PASS ProgressEvent: security consideration 
 
index aaaa48e..563198b 100644 (file)
@@ -1,5 +1,5 @@
 
-FAIL abort() called from data stringification The object is in an invalid state.
+PASS abort() called from data stringification 
 PASS open() called from data stringification 
 PASS send() called from data stringification 
 
index 2794dd6..15dbb27 100644 (file)
@@ -1,3 +1,47 @@
+2018-03-28  Chris Dumez  <cdumez@apple.com>
+
+        Align XMLHttpRequest's open() / send() / abort() with the latest specification
+        https://bugs.webkit.org/show_bug.cgi?id=184108
+
+        Reviewed by Youenn Fablet.
+
+        Align XMLHttpRequest's open() / send() / abort() with the latest specification:
+        - https://xhr.spec.whatwg.org
+
+        No new tests, rebaselined existing layout tests.
+
+        * xml/XMLHttpRequest.cpp:
+        (WebCore::XMLHttpRequest::open):
+        Align with https://xhr.spec.whatwg.org/#the-open()-method:
+        - Change the order of some steps to match the order in the spec. In particular,
+          open() no longer resets the state to UNSENT or abort any existing load when it
+          fails early due to being passed a bad method.
+
+        (WebCore::XMLHttpRequest::createRequest):
+        Align with https://xhr.spec.whatwg.org/#the-send()-method:
+        - Use the simpler "upload listener flag" logic from the spec instead of our more
+          complex m_uploadEventsAllowed flag. This avoids constructing a SecurityOrigin
+          objects on a background thread when XHR is used inside Web Workers, which was
+          not thread-safe.
+        - Set the upload complete flag when the request has no body as per step 9.
+        - After firing the loadstartEvent, return early if the state is no longer OPEN or
+          if the send flag is unset, as per step 11.3.
+
+        (WebCore::XMLHttpRequest::abort):
+        Align with https://xhr.spec.whatwg.org/#the-abort()-method:
+        - Only set the state to UNSENT if the state is still DONE after firing the error
+          events, as per step 3.
+
+        (WebCore::XMLHttpRequest::didSendData):
+        Use new "upload listener flag".
+
+        (WebCore::XMLHttpRequest::dispatchErrorEvents):
+        Align with https://xhr.spec.whatwg.org/#request-error-steps:
+        - Stop firing a progress event in case of error as this is not as per specification
+          and Firefox does not fire those either.
+
+        * xml/XMLHttpRequest.h:
+
 2018-03-28  Timothy Hatcher  <timothy@apple.com>
 
         Consolidate NSColor to WebCore::Color conversion and fix system colors.
index 91fbb72..6c482d2 100644 (file)
@@ -329,22 +329,6 @@ ExceptionOr<void> XMLHttpRequest::open(const String& method, const String& url)
 
 ExceptionOr<void> XMLHttpRequest::open(const String& method, const URL& url, bool async)
 {
-    if (!internalAbort())
-        return { };
-
-    State previousState = m_state;
-    m_state = UNSENT;
-    m_error = false;
-    m_sendFlag = false;
-    m_uploadComplete = false;
-    m_wasAbortedByClient = false;
-
-    // clear stuff from possible previous load
-    clearResponse();
-    clearRequest();
-
-    ASSERT(m_state == UNSENT);
-
     if (!isValidHTTPToken(method))
         return Exception { SyntaxError };
 
@@ -368,7 +352,19 @@ ExceptionOr<void> XMLHttpRequest::open(const String& method, const URL& url, boo
         }
     }
 
+    if (!internalAbort())
+        return { };
+
+    m_sendFlag = false;
+    m_uploadListenerFlag = false;
     m_method = normalizeHTTPMethod(method);
+    m_error = false;
+    m_uploadComplete = false;
+    m_wasAbortedByClient = false;
+
+    // clear stuff from possible previous load
+    clearResponse();
+    clearRequest();
 
     m_url = url;
     scriptExecutionContext()->contentSecurityPolicy()->upgradeInsecureRequestIfNeeded(m_url, ContentSecurityPolicy::InsecureRequestType::Load);
@@ -377,12 +373,7 @@ ExceptionOr<void> XMLHttpRequest::open(const String& method, const URL& url, boo
 
     ASSERT(!m_loader);
 
-    // Check previous state to avoid dispatching readyState event
-    // when calling open several times in a row.
-    if (previousState != OPENED)
-        changeState(OPENED);
-    else
-        m_state = OPENED;
+    changeState(OPENED);
 
     return { };
 }
@@ -571,25 +562,8 @@ ExceptionOr<void> XMLHttpRequest::createRequest()
     if (!m_async && m_url.protocolIsBlob() && m_method != "GET")
         return Exception { NetworkError };
 
-    m_sendFlag = true;
-
-    // The presence of upload event listeners forces us to use preflighting because POSTing to an URL that does not
-    // permit cross origin requests should look exactly like POSTing to an URL that does not respond at all.
-    // Also, only async requests support upload progress events.
-    bool uploadEvents = false;
-    if (m_async) {
-        m_progressEventThrottle.dispatchProgressEvent(eventNames().loadstartEvent);
-        if (m_requestEntityBody && m_upload) {
-            uploadEvents = m_upload->hasEventListeners();
-            m_upload->dispatchProgressEvent(eventNames().loadstartEvent);
-        }
-    }
-
-    m_sameOriginRequest = securityOrigin()->canRequest(m_url);
-
-    // We also remember whether upload events should be allowed for this request in case the upload listeners are
-    // added after the request is started.
-    m_uploadEventsAllowed = m_sameOriginRequest || uploadEvents || !isSimpleCrossOriginAccessRequest(m_method, m_requestHeaders);
+    if (m_async && m_upload && m_upload->hasEventListeners())
+        m_uploadListenerFlag = true;
 
     ResourceRequest request(m_url);
     request.setRequester(ResourceRequest::Requester::XHR);
@@ -607,7 +581,9 @@ ExceptionOr<void> XMLHttpRequest::createRequest()
 
     ThreadableLoaderOptions options;
     options.sendLoadCallbacks = SendCallbacks;
-    options.preflightPolicy = uploadEvents ? ForcePreflight : ConsiderPreflight;
+    // The presence of upload event listeners forces us to use preflighting because POSTing to an URL that does not
+    // permit cross origin requests should look exactly like POSTing to an URL that does not respond at all.
+    options.preflightPolicy = m_uploadListenerFlag ? ForcePreflight : ConsiderPreflight;
     options.credentials = m_includeCredentials ? FetchOptions::Credentials::Include : FetchOptions::Credentials::SameOrigin;
     options.mode = FetchOptions::Mode::Cors;
     options.contentSecurityPolicyEnforcement = scriptExecutionContext()->shouldBypassMainWorldContentSecurityPolicy() ? ContentSecurityPolicyEnforcement::DoNotEnforce : ContentSecurityPolicyEnforcement::EnforceConnectSrcDirective;
@@ -628,8 +604,17 @@ ExceptionOr<void> XMLHttpRequest::createRequest()
 
     m_exceptionCode = std::nullopt;
     m_error = false;
+    m_uploadComplete = !request.httpBody();
+    m_sendFlag = true;
 
     if (m_async) {
+        m_progressEventThrottle.dispatchProgressEvent(eventNames().loadstartEvent);
+        if (!m_uploadComplete && m_uploadListenerFlag)
+            m_upload->dispatchProgressEvent(eventNames().loadstartEvent);
+
+        if (m_state != OPENED || !m_sendFlag || m_loader)
+            return { };
+
         // ThreadableLoader::create can return null here, for example if we're no longer attached to a page or if a content blocker blocks the load.
         // This is true while running onunload handlers.
         // FIXME: Maybe we need to be able to send XMLHttpRequests from onunload, <http://bugs.webkit.org/show_bug.cgi?id=10904>.
@@ -668,7 +653,6 @@ void XMLHttpRequest::abort()
 
     clearResponseBuffers();
 
-    // Clear headers as required by the spec
     m_requestHeaders.clear();
     if ((m_state == OPENED && m_sendFlag) || m_state == HEADERS_RECEIVED || m_state == LOADING) {
         ASSERT(!m_loader);
@@ -676,7 +660,8 @@ void XMLHttpRequest::abort()
         changeState(DONE);
         dispatchErrorEvents(eventNames().abortEvent);
     }
-    m_state = UNSENT;
+    if (m_state == DONE)
+        m_state = UNSENT;
 }
 
 bool XMLHttpRequest::internalAbort()
@@ -960,11 +945,12 @@ void XMLHttpRequest::didSendData(unsigned long long bytesSent, unsigned long lon
     if (!m_upload)
         return;
 
-    if (m_uploadEventsAllowed)
+    if (m_uploadListenerFlag)
         m_upload->dispatchThrottledProgressEvent(true, bytesSent, totalBytesToBeSent);
+
     if (bytesSent == totalBytesToBeSent && !m_uploadComplete) {
         m_uploadComplete = true;
-        if (m_uploadEventsAllowed) {
+        if (m_uploadListenerFlag) {
             m_upload->dispatchProgressEvent(eventNames().loadEvent);
             m_upload->dispatchProgressEvent(eventNames().loadendEvent);
         }
@@ -1083,13 +1069,11 @@ void XMLHttpRequest::dispatchErrorEvents(const AtomicString& type)
 {
     if (!m_uploadComplete) {
         m_uploadComplete = true;
-        if (m_upload && m_uploadEventsAllowed) {
-            m_upload->dispatchProgressEvent(eventNames().progressEvent);
+        if (m_upload && m_uploadListenerFlag) {
             m_upload->dispatchProgressEvent(type);
             m_upload->dispatchProgressEvent(eventNames().loadendEvent);
         }
     }
-    m_progressEventThrottle.dispatchProgressEvent(eventNames().progressEvent);
     m_progressEventThrottle.dispatchProgressEvent(type);
     m_progressEventThrottle.dispatchProgressEvent(eventNames().loadendEvent);
 }
index cb92544..1eec158 100644 (file)
@@ -205,10 +205,9 @@ private:
 
     bool m_error { false };
 
-    bool m_uploadEventsAllowed { true };
+    bool m_uploadListenerFlag { false };
     bool m_uploadComplete { false };
 
-    bool m_sameOriginRequest { true };
     bool m_wasAbortedByClient { false };
 
     // Used for progress event tracking.