diff options
author | Moonchild <moonchild@palemoon.org> | 2020-06-12 01:08:26 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2020-06-12 01:08:26 +0000 |
commit | 94c694d389ceb2c797d7ee1854cc84c87349c2f5 (patch) | |
tree | d34c6032064aa9bb8569618b15c5984118a54cd1 | |
parent | e97a29a6569fac73e81cf46a0e682ac926ea3456 (diff) | |
download | uxp-94c694d389ceb2c797d7ee1854cc84c87349c2f5.tar.gz |
Issue #1587 - Part 8: Remove controller follow/unfollow
Since it didn't end up being in the final spec after all.
-rw-r--r-- | dom/abort/AbortController.cpp | 31 | ||||
-rw-r--r-- | dom/abort/AbortController.h | 14 | ||||
-rw-r--r-- | dom/abort/AbortSignal.cpp | 27 | ||||
-rw-r--r-- | dom/abort/AbortSignal.h | 3 | ||||
-rw-r--r-- | dom/abort/tests/file_abort_controller.html | 48 | ||||
-rw-r--r-- | dom/webidl/AbortController.webidl | 2 |
6 files changed, 1 insertions, 124 deletions
diff --git a/dom/abort/AbortController.cpp b/dom/abort/AbortController.cpp index 4043b7bf3e..bd8159e7b5 100644 --- a/dom/abort/AbortController.cpp +++ b/dom/abort/AbortController.cpp @@ -12,8 +12,7 @@ namespace mozilla { namespace dom { -NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(AbortController, mGlobal, mSignal, - mFollowingSignal) +NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(AbortController, mGlobal, mSignal) NS_IMPL_CYCLE_COLLECTING_ADDREF(AbortController) NS_IMPL_CYCLE_COLLECTING_RELEASE(AbortController) @@ -95,33 +94,5 @@ AbortController::Abort() } } -void -AbortController::Follow(AbortSignal& aSignal) -{ - AbortSignal::Follower::Follow(&aSignal); -} - -void -AbortController::Unfollow(AbortSignal& aSignal) -{ - if (mFollowingSignal != &aSignal) { - return; - } - - AbortSignal::Follower::Unfollow(); -} - -AbortSignal* -AbortController::Following() const -{ - return mFollowingSignal; -} - -void -AbortController::Aborted() -{ - Abort(); -} - } // dom namespace } // mozilla namespace diff --git a/dom/abort/AbortController.h b/dom/abort/AbortController.h index 9ce4253c93..0b99dc49c2 100644 --- a/dom/abort/AbortController.h +++ b/dom/abort/AbortController.h @@ -19,7 +19,6 @@ namespace dom { class AbortController final : public nsISupports , public nsWrapperCache - , public AbortSignal::Follower { public: NS_DECL_CYCLE_COLLECTING_ISUPPORTS @@ -45,19 +44,6 @@ public: void Abort(); - void - Follow(AbortSignal& aSignal); - - void - Unfollow(AbortSignal& aSignal); - - AbortSignal* - Following() const; - - // AbortSignal::Follower - - void Aborted() override; - private: ~AbortController() = default; diff --git a/dom/abort/AbortSignal.cpp b/dom/abort/AbortSignal.cpp index 38b0a2492c..20f36d2abb 100644 --- a/dom/abort/AbortSignal.cpp +++ b/dom/abort/AbortSignal.cpp @@ -68,8 +68,6 @@ AbortSignal::Abort() init.mBubbles = false; init.mCancelable = false; - // TODO which kind of event should we dispatch here? - RefPtr<Event> event = Event::Constructor(this, NS_LITERAL_STRING("abort"), init); event->SetTrusted(true); @@ -94,27 +92,6 @@ AbortSignal::RemoveFollower(AbortSignal::Follower* aFollower) mFollowers.RemoveElement(aFollower); } -bool -AbortSignal::CanAcceptFollower(AbortSignal::Follower* aFollower) const -{ - MOZ_DIAGNOSTIC_ASSERT(aFollower); - - if (!mController) { - return true; - } - - if (aFollower == mController) { - return false; - } - - AbortSignal* following = mController->Following(); - if (!following) { - return true; - } - - return following->CanAcceptFollower(aFollower); -} - // AbortSignal::Follower // ---------------------------------------------------------------------------- @@ -128,10 +105,6 @@ AbortSignal::Follower::Follow(AbortSignal* aSignal) { MOZ_DIAGNOSTIC_ASSERT(aSignal); - if (!aSignal->CanAcceptFollower(this)) { - return; - } - Unfollow(); mFollowingSignal = aSignal; diff --git a/dom/abort/AbortSignal.h b/dom/abort/AbortSignal.h index c5045dbd69..35e5829429 100644 --- a/dom/abort/AbortSignal.h +++ b/dom/abort/AbortSignal.h @@ -59,9 +59,6 @@ public: void RemoveFollower(Follower* aFollower); - bool - CanAcceptFollower(Follower* aFollower) const; - private: ~AbortSignal() = default; diff --git a/dom/abort/tests/file_abort_controller.html b/dom/abort/tests/file_abort_controller.html index e4137aac9e..3a15fa3469 100644 --- a/dom/abort/tests/file_abort_controller.html +++ b/dom/abort/tests/file_abort_controller.html @@ -32,49 +32,6 @@ function testUpdateData() { next(); } -function testFollowingOurself() { - // Let's follow ourself - var fc = new FetchController(); - fc.follow(fc.signal); - - fc.abort(); - is(fc.signal.aborted, true, "Signal is aborted"); - - next(); -} - -function testFollowingOther() { - // Let's follow another one - var fc1 = new FetchController(); - var fc2 = new FetchController(); - fc1.follow(fc2.signal); - - fc2.abort(); - - is(fc1.signal.aborted, true, "Signal is aborted"); - is(fc2.signal.aborted, true, "Signal is aborted"); - - next(); -} - -function testFollowingLoop() { - // fc1 -> fc2 -> fc3 -> fc1 - var fc1 = new FetchController(); - var fc2 = new FetchController(); - var fc3 = new FetchController(); - fc1.follow(fc2.signal); - fc2.follow(fc3.signal); - fc3.follow(fc1.signal); - - fc3.abort(); - - is(fc1.signal.aborted, true, "Signal is aborted"); - is(fc2.signal.aborted, true, "Signal is aborted"); - is(fc3.signal.aborted, true, "Signal is aborted"); - - next(); -} - function testAbortEvent() { var fc = new FetchController(); fc.signal.onabort = function(e) { @@ -131,11 +88,6 @@ var steps = [ testWebIDL, testUpdateData, - // Following algorithm - testFollowingOurself, - testFollowingOther, - testFollowingLoop, - // Event propagation testAbortEvent, diff --git a/dom/webidl/AbortController.webidl b/dom/webidl/AbortController.webidl index f5d8f317bc..4e91240751 100644 --- a/dom/webidl/AbortController.webidl +++ b/dom/webidl/AbortController.webidl @@ -10,6 +10,4 @@ interface AbortController { readonly attribute AbortSignal signal; void abort(); - void follow(AbortSignal signal); - void unfollow(AbortSignal signal); }; |