Bug 742194 part 2. Use the new uncatchable exception machinery in worker XHR code. r=khuey

This commit is contained in:
Boris Zbarsky 2015-02-20 23:58:40 -05:00
parent 9e8395b4c9
commit 0ef6163776

View File

@ -32,9 +32,6 @@ using namespace mozilla;
using namespace mozilla::dom;
USING_WORKERS_NAMESPACE
// XXX Need to figure this out...
#define UNCATCHABLE_EXCEPTION NS_ERROR_OUT_OF_MEMORY
/**
* XMLHttpRequest in workers
*
@ -1907,7 +1904,7 @@ XMLHttpRequest::Open(const nsACString& aMethod, const nsAString& aUrl,
mWorkerPrivate->AssertIsOnWorkerThread();
if (mCanceled) {
aRv.Throw(UNCATCHABLE_EXCEPTION);
aRv.ThrowUncatchableException();
return;
}
@ -1944,7 +1941,7 @@ XMLHttpRequest::SetRequestHeader(const nsACString& aHeader,
mWorkerPrivate->AssertIsOnWorkerThread();
if (mCanceled) {
aRv.Throw(UNCATCHABLE_EXCEPTION);
aRv.ThrowUncatchableException();
return;
}
@ -1967,7 +1964,7 @@ XMLHttpRequest::SetTimeout(uint32_t aTimeout, ErrorResult& aRv)
mWorkerPrivate->AssertIsOnWorkerThread();
if (mCanceled) {
aRv.Throw(UNCATCHABLE_EXCEPTION);
aRv.ThrowUncatchableException();
return;
}
@ -1993,7 +1990,7 @@ XMLHttpRequest::SetWithCredentials(bool aWithCredentials, ErrorResult& aRv)
mWorkerPrivate->AssertIsOnWorkerThread();
if (mCanceled) {
aRv.Throw(UNCATCHABLE_EXCEPTION);
aRv.ThrowUncatchableException();
return;
}
@ -2020,7 +2017,7 @@ XMLHttpRequest::SetMozBackgroundRequest(bool aBackgroundRequest,
mWorkerPrivate->AssertIsOnWorkerThread();
if (mCanceled) {
aRv.Throw(UNCATCHABLE_EXCEPTION);
aRv.ThrowUncatchableException();
return;
}
@ -2047,7 +2044,7 @@ XMLHttpRequest::GetUpload(ErrorResult& aRv)
mWorkerPrivate->AssertIsOnWorkerThread();
if (mCanceled) {
aRv.Throw(UNCATCHABLE_EXCEPTION);
aRv.ThrowUncatchableException();
return nullptr;
}
@ -2069,7 +2066,7 @@ XMLHttpRequest::Send(ErrorResult& aRv)
mWorkerPrivate->AssertIsOnWorkerThread();
if (mCanceled) {
aRv.Throw(UNCATCHABLE_EXCEPTION);
aRv.ThrowUncatchableException();
return;
}
@ -2091,7 +2088,7 @@ XMLHttpRequest::Send(const nsAString& aBody, ErrorResult& aRv)
mWorkerPrivate->AssertIsOnWorkerThread();
if (mCanceled) {
aRv.Throw(UNCATCHABLE_EXCEPTION);
aRv.ThrowUncatchableException();
return;
}
@ -2117,7 +2114,7 @@ XMLHttpRequest::Send(JS::Handle<JSObject*> aBody, ErrorResult& aRv)
mWorkerPrivate->AssertIsOnWorkerThread();
if (mCanceled) {
aRv.Throw(UNCATCHABLE_EXCEPTION);
aRv.ThrowUncatchableException();
return;
}
@ -2163,7 +2160,7 @@ XMLHttpRequest::Send(File& aBody, ErrorResult& aRv)
JSContext* cx = mWorkerPrivate->GetJSContext();
if (mCanceled) {
aRv.Throw(UNCATCHABLE_EXCEPTION);
aRv.ThrowUncatchableException();
return;
}
@ -2230,7 +2227,7 @@ XMLHttpRequest::Abort(ErrorResult& aRv)
mWorkerPrivate->AssertIsOnWorkerThread();
if (mCanceled) {
aRv.Throw(UNCATCHABLE_EXCEPTION);
aRv.ThrowUncatchableException();
}
if (!mProxy) {
@ -2258,7 +2255,7 @@ XMLHttpRequest::GetResponseHeader(const nsACString& aHeader,
mWorkerPrivate->AssertIsOnWorkerThread();
if (mCanceled) {
aRv.Throw(UNCATCHABLE_EXCEPTION);
aRv.ThrowUncatchableException();
return;
}
@ -2285,7 +2282,7 @@ XMLHttpRequest::GetAllResponseHeaders(nsACString& aResponseHeaders,
mWorkerPrivate->AssertIsOnWorkerThread();
if (mCanceled) {
aRv.Throw(UNCATCHABLE_EXCEPTION);
aRv.ThrowUncatchableException();
return;
}
@ -2311,7 +2308,7 @@ XMLHttpRequest::OverrideMimeType(const nsAString& aMimeType, ErrorResult& aRv)
mWorkerPrivate->AssertIsOnWorkerThread();
if (mCanceled) {
aRv.Throw(UNCATCHABLE_EXCEPTION);
aRv.ThrowUncatchableException();
return;
}
@ -2342,7 +2339,7 @@ XMLHttpRequest::SetResponseType(XMLHttpRequestResponseType aResponseType,
mWorkerPrivate->AssertIsOnWorkerThread();
if (mCanceled) {
aRv.Throw(UNCATCHABLE_EXCEPTION);
aRv.ThrowUncatchableException();
return;
}