From 0ef61637760082380f2fca99b9fc5f4f8035241b Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 20 Feb 2015 23:58:40 -0500 Subject: [PATCH] Bug 742194 part 2. Use the new uncatchable exception machinery in worker XHR code. r=khuey --- dom/workers/XMLHttpRequest.cpp | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/dom/workers/XMLHttpRequest.cpp b/dom/workers/XMLHttpRequest.cpp index 1bae6bd19eb6..e2b9b625e5d0 100644 --- a/dom/workers/XMLHttpRequest.cpp +++ b/dom/workers/XMLHttpRequest.cpp @@ -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 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; }