зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset c6819fdea3a5 (bug 1695216) for causing XMLHttpRequestWorker related crashes. CLOSED TREE
This commit is contained in:
Родитель
be9ce24188
Коммит
e2e44b6376
|
@ -2239,17 +2239,6 @@ XMLHttpRequestMainThread::OnStopRequest(nsIRequest* request, nsresult status) {
|
|||
|
||||
mErrorLoad = ErrorType::eUnreachable;
|
||||
mResponseXML = nullptr;
|
||||
|
||||
// Handle network errors specifically per spec.
|
||||
if (NS_ERROR_GET_MODULE(status) == NS_ERROR_MODULE_NETWORK) {
|
||||
IgnoredErrorResult rv;
|
||||
RequestErrorSteps(ProgressEventType::error, NS_ERROR_DOM_NETWORK_ERR, rv);
|
||||
// RequestErrorSteps sets state to DONE, but because we are throwing an
|
||||
// error, a progress event is never fired. Calling ChangeStateToDone
|
||||
// ensures that.
|
||||
ChangeStateToDone(wasSync);
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
|
||||
// If we're uninitialized at this point, we encountered an error
|
||||
|
|
|
@ -1697,13 +1697,6 @@ void XMLHttpRequestWorker::SendInternal(const BodyExtractorBase* aBody,
|
|||
bool succeeded = autoSyncLoop->Run();
|
||||
mStateData->mFlagSend = false;
|
||||
|
||||
// If the XHR failed, throw a network error.
|
||||
if (mProxy->mXHR->ErrorCode() !=
|
||||
static_cast<uint16_t>(XMLHttpRequestMainThread::ErrorType::eOK)) {
|
||||
aRv.Throw(NS_ERROR_DOM_NETWORK_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
// Don't clobber an existing exception that we may have thrown on aRv
|
||||
// already... though can there really be one? In any case, it seems to me
|
||||
// that this autoSyncLoop->Run() can never fail, since the StopSyncLoop call
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
[response-body-errors.any.html]
|
||||
[Asynchronous XMLHttpRequest should clear response on bad chunk]
|
||||
expected: FAIL
|
||||
|
||||
|
||||
[response-body-errors.any.worker.html]
|
||||
[Synchronous XMLHttpRequest should throw on bad chunk]
|
||||
expected: FAIL
|
||||
|
||||
[Asynchronous XMLHttpRequest should clear response on bad chunk]
|
||||
expected: FAIL
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
// This will transmit two chunks TEST_CHUNK and then garbage, which should result in an error.
|
||||
const url = "/fetch/api/resources/bad-chunk-encoding.py?ms=100&count=2";
|
||||
const url = "/fetch/api/resources/bad-chunk-encoding.py?ms=1&count=2";
|
||||
|
||||
test(() => {
|
||||
client = new XMLHttpRequest();
|
||||
|
|
Загрузка…
Ссылка в новой задаче