summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dom/abort/AbortController.cpp31
-rw-r--r--dom/abort/AbortController.h14
-rw-r--r--dom/abort/AbortSignal.cpp27
-rw-r--r--dom/abort/AbortSignal.h3
-rw-r--r--dom/abort/tests/file_abort_controller.html48
-rw-r--r--dom/webidl/AbortController.webidl2
6 files changed, 1 insertions, 124 deletions
diff --git a/dom/abort/AbortController.cpp b/dom/abort/AbortController.cpp
index 4043b7bf3..bd8159e7b 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 9ce4253c9..0b99dc49c 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 38b0a2492..20f36d2ab 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 c5045dbd6..35e582942 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 e4137aac9..3a15fa346 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 f5d8f317b..4e9124075 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);
};