summaryrefslogtreecommitdiff
path: root/dom/fetch/FetchController.cpp
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2020-06-10 21:33:28 +0000
committerMoonchild <moonchild@palemoon.org>2020-06-10 21:33:47 +0000
commitbe82b3331878fb2956d22d9bd3906fca3ab39751 (patch)
tree99b99c83d520b5309fdc9ee4f1afb00eeaa5f964 /dom/fetch/FetchController.cpp
parenta8602cc877cb4fc007655cd0f52b52b1e7165bc8 (diff)
downloaduxp-be82b3331878fb2956d22d9bd3906fca3ab39751.tar.gz
Issue #1587 - Part 2: Implement controller follow/unfollow
Diffstat (limited to 'dom/fetch/FetchController.cpp')
-rw-r--r--dom/fetch/FetchController.cpp23
1 files changed, 20 insertions, 3 deletions
diff --git a/dom/fetch/FetchController.cpp b/dom/fetch/FetchController.cpp
index b3d8a4d9c5..2eb40b9800 100644
--- a/dom/fetch/FetchController.cpp
+++ b/dom/fetch/FetchController.cpp
@@ -12,7 +12,8 @@
namespace mozilla {
namespace dom {
-NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(FetchController, mGlobal, mSignal)
+NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(FetchController, mGlobal, mSignal,
+ mFollowingSignal)
NS_IMPL_CYCLE_COLLECTING_ADDREF(FetchController)
NS_IMPL_CYCLE_COLLECTING_RELEASE(FetchController)
@@ -97,13 +98,29 @@ FetchController::Abort()
void
FetchController::Follow(FetchSignal& aSignal)
{
- // TODO
+ FetchSignal::Follower::Follow(&aSignal);
}
void
FetchController::Unfollow(FetchSignal& aSignal)
{
- // TODO
+ if (mFollowingSignal != &aSignal) {
+ return;
+ }
+
+ FetchSignal::Follower::Unfollow();
+}
+
+FetchSignal*
+FetchController::Following() const
+{
+ return mFollowingSignal;
+}
+
+void
+FetchController::Aborted()
+{
+ Abort();
}
} // dom namespace