From 04cd5ddc32b678b13281d031533e2f142e2e31d2 Mon Sep 17 00:00:00 2001 From: Andrea Marchesini Date: Wed, 27 Sep 2017 03:50:46 +0200 Subject: [PATCH] Bug 1402317 - Remove dom.abortController.enabled and dom.abortController.fetch.enabled prefs, r=qdot --- dom/abort/AbortController.cpp | 38 ---------- dom/abort/AbortController.h | 6 -- dom/abort/tests/file_abort_controller.html | 65 ----------------- .../tests/file_abort_controller_fetch.html | 72 ------------------- dom/abort/tests/mochitest.ini | 2 - dom/abort/tests/test_abort_controller.html | 64 +++++++++++++---- .../tests/test_abort_controller_fetch.html | 72 ++++++++++++++----- .../mochitest/fetch/test_fetch_observer.html | 4 +- dom/webidl/AbortController.webidl | 3 +- dom/webidl/AbortSignal.webidl | 3 +- dom/webidl/Request.webidl | 4 +- dom/workers/WorkerPrefs.h | 2 - modules/libpref/init/all.js | 6 -- testing/web-platform/meta/dom/__dir__.ini | 1 - .../web-platform/meta/dom/abort/__dir__.ini | 1 - .../meta/fetch/api/abort/__dir__.ini | 2 - 16 files changed, 109 insertions(+), 236 deletions(-) delete mode 100644 dom/abort/tests/file_abort_controller.html delete mode 100644 dom/abort/tests/file_abort_controller_fetch.html delete mode 100644 testing/web-platform/meta/dom/__dir__.ini delete mode 100644 testing/web-platform/meta/dom/abort/__dir__.ini diff --git a/dom/abort/AbortController.cpp b/dom/abort/AbortController.cpp index 3430109a8e39..b0b7ed59faec 100644 --- a/dom/abort/AbortController.cpp +++ b/dom/abort/AbortController.cpp @@ -22,44 +22,6 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(AbortController) NS_INTERFACE_MAP_ENTRY(nsISupports) NS_INTERFACE_MAP_END -/* static */ bool -AbortController::IsEnabled(JSContext* aCx, JSObject* aGlobal) -{ - if (NS_IsMainThread()) { - return Preferences::GetBool("dom.abortController.enabled", false); - } - - using namespace workers; - - // Otherwise, check the pref via the WorkerPrivate - WorkerPrivate* workerPrivate = GetWorkerPrivateFromContext(aCx); - if (!workerPrivate) { - return false; - } - - return workerPrivate->AbortControllerEnabled(); -} - -/* static */ bool -AbortController::IsEnabledInFetch(JSContext* aCx, JSObject* aGlobal) -{ - if (NS_IsMainThread()) { - return IsEnabled(aCx, aGlobal) && - Preferences::GetBool("dom.abortController.fetch.enabled", false); - } - - using namespace workers; - - // Otherwise, check the pref via the WorkerPrivate - WorkerPrivate* workerPrivate = GetWorkerPrivateFromContext(aCx); - if (!workerPrivate) { - return false; - } - - return workerPrivate->AbortControllerEnabled() && - workerPrivate->AbortControllerEnabledInFetch(); -} - /* static */ already_AddRefed AbortController::Constructor(const GlobalObject& aGlobal, ErrorResult& aRv) { diff --git a/dom/abort/AbortController.h b/dom/abort/AbortController.h index 05151ded14c6..cf96768b99b6 100644 --- a/dom/abort/AbortController.h +++ b/dom/abort/AbortController.h @@ -26,12 +26,6 @@ public: NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(AbortController) - static bool - IsEnabled(JSContext* aCx, JSObject* aGlobal); - - static bool - IsEnabledInFetch(JSContext* aCx, JSObject* aGlobal); - static already_AddRefed Constructor(const GlobalObject& aGlobal, ErrorResult& aRv); diff --git a/dom/abort/tests/file_abort_controller.html b/dom/abort/tests/file_abort_controller.html deleted file mode 100644 index a06fa3926597..000000000000 --- a/dom/abort/tests/file_abort_controller.html +++ /dev/null @@ -1,65 +0,0 @@ - diff --git a/dom/abort/tests/file_abort_controller_fetch.html b/dom/abort/tests/file_abort_controller_fetch.html deleted file mode 100644 index ea959fdca83b..000000000000 --- a/dom/abort/tests/file_abort_controller_fetch.html +++ /dev/null @@ -1,72 +0,0 @@ - diff --git a/dom/abort/tests/mochitest.ini b/dom/abort/tests/mochitest.ini index 36e12bae8749..9817a9e9aa10 100644 --- a/dom/abort/tests/mochitest.ini +++ b/dom/abort/tests/mochitest.ini @@ -1,7 +1,5 @@ [DEFAULT] support-files = - file_abort_controller.html - file_abort_controller_fetch.html worker_abort_controller_fetch.js slow.sjs diff --git a/dom/abort/tests/test_abort_controller.html b/dom/abort/tests/test_abort_controller.html index 2230dced357b..398b491ba5a9 100644 --- a/dom/abort/tests/test_abort_controller.html +++ b/dom/abort/tests/test_abort_controller.html @@ -12,27 +12,61 @@ diff --git a/dom/abort/tests/test_abort_controller_fetch.html b/dom/abort/tests/test_abort_controller_fetch.html index 24e005d1cb0c..334f25194d0f 100644 --- a/dom/abort/tests/test_abort_controller_fetch.html +++ b/dom/abort/tests/test_abort_controller_fetch.html @@ -12,28 +12,68 @@ diff --git a/dom/tests/mochitest/fetch/test_fetch_observer.html b/dom/tests/mochitest/fetch/test_fetch_observer.html index 7475e06901f2..2b6c0362d264 100644 --- a/dom/tests/mochitest/fetch/test_fetch_observer.html +++ b/dom/tests/mochitest/fetch/test_fetch_observer.html @@ -12,9 +12,7 @@