Skip to content

Commit

Permalink
Bug 1655115 - Remove unused code paths leading to dom::cache::StreamC…
Browse files Browse the repository at this point in the history
…ontrol::CloseReadStreams() r=dom-workers-and-storage-reviewers,ttung

Differential Revision: https://phabricator.services.mozilla.com/D85364
  • Loading branch information
ssengupta committed Aug 4, 2020
1 parent 57df1c6 commit 3ed5b7a
Show file tree
Hide file tree
Showing 10 changed files with 0 additions and 57 deletions.
6 changes: 0 additions & 6 deletions dom/cache/CacheStreamControlChild.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,6 @@ void CacheStreamControlChild::ActorDestroy(ActorDestroyReason aReason) {
RemoveWorkerRef();
}

mozilla::ipc::IPCResult CacheStreamControlChild::RecvClose(const nsID& aId) {
NS_ASSERT_OWNINGTHREAD(CacheStreamControlChild);
CloseReadStreams(aId);
return IPC_OK();
}

mozilla::ipc::IPCResult CacheStreamControlChild::RecvCloseAll() {
NS_ASSERT_OWNINGTHREAD(CacheStreamControlChild);
CloseAllReadStreams();
Expand Down
11 changes: 0 additions & 11 deletions dom/cache/CacheStreamControlParent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,6 @@ void CacheStreamControlParent::SetStreamList(
mStreamList = std::move(aStreamList);
}

void CacheStreamControlParent::Close(const nsID& aId) {
NS_ASSERT_OWNINGTHREAD(CacheStreamControlParent);
NotifyClose(aId);
Unused << SendClose(aId);
}

void CacheStreamControlParent::CloseAll() {
NS_ASSERT_OWNINGTHREAD(CacheStreamControlParent);
NotifyCloseAll();
Expand All @@ -154,11 +148,6 @@ void CacheStreamControlParent::Shutdown() {
}
}

void CacheStreamControlParent::NotifyClose(const nsID& aId) {
NS_ASSERT_OWNINGTHREAD(CacheStreamControlParent);
CloseReadStreams(aId);
}

void CacheStreamControlParent::NotifyCloseAll() {
NS_ASSERT_OWNINGTHREAD(CacheStreamControlParent);
CloseAllReadStreams();
Expand Down
2 changes: 0 additions & 2 deletions dom/cache/CacheStreamControlParent.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class CacheStreamControlParent final : public PCacheStreamControlParent,
CacheStreamControlParent();

void SetStreamList(SafeRefPtr<StreamList> aStreamList);
void Close(const nsID& aId);
void CloseAll();
void Shutdown();

Expand Down Expand Up @@ -62,7 +61,6 @@ class CacheStreamControlParent final : public PCacheStreamControlParent,

mozilla::ipc::IPCResult RecvNoteClosed(const nsID& aId);

void NotifyClose(const nsID& aId);
void NotifyCloseAll();

// Cycle with StreamList via a weak-ref to us. Cleanup occurs when the actor
Expand Down
1 change: 0 additions & 1 deletion dom/cache/PCacheStreamControl.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ parent:
async NoteClosed(nsID aStreamId);

child:
async Close(nsID aStreamId);
async CloseAll();
async __delete__();
};
Expand Down
7 changes: 0 additions & 7 deletions dom/cache/ReadStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ class ReadStream::Inner final : public ReadStream::Controllable {

virtual void CloseStreamWithoutReporting() override;

virtual bool MatchId(const nsID& aId) const override;

virtual bool HasEverBeenRead() const override;

// Simulate nsIInputStream methods, but we don't actually inherit from it
Expand Down Expand Up @@ -247,11 +245,6 @@ void ReadStream::Inner::CloseStreamWithoutReporting() {
Forget();
}

bool ReadStream::Inner::MatchId(const nsID& aId) const {
MOZ_ASSERT(mOwningEventTarget->IsOnCurrentThread());
return mId.Equals(aId);
}

bool ReadStream::Inner::HasEverBeenRead() const {
MOZ_ASSERT(mOwningEventTarget->IsOnCurrentThread());
return mHasEverBeenRead;
Expand Down
2 changes: 0 additions & 2 deletions dom/cache/ReadStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ class ReadStream final : public nsIInputStream {
// notify.
virtual void CloseStreamWithoutReporting() = 0;

virtual bool MatchId(const nsID& aId) const = 0;

virtual bool HasEverBeenRead() const = 0;

MOZ_DECLARE_REFCOUNTED_TYPENAME(ReadStream::Controllable);
Expand Down
18 changes: 0 additions & 18 deletions dom/cache/StreamControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,6 @@ StreamControl::~StreamControl() {
MOZ_DIAGNOSTIC_ASSERT(mReadStreamList.IsEmpty());
}

void StreamControl::CloseReadStreams(const nsID& aId) {
AssertOwningThread();
#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
uint32_t closedCount = 0;
#endif

for (const auto& stream : mReadStreamList.ForwardRange()) {
if (stream->MatchId(aId)) {
stream->CloseStream();
#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
closedCount += 1;
#endif
}
}

MOZ_DIAGNOSTIC_ASSERT(closedCount > 0);
}

void StreamControl::CloseAllReadStreams() {
AssertOwningThread();

Expand Down
2 changes: 0 additions & 2 deletions dom/cache/StreamControl.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ class StreamControl {
protected:
~StreamControl();

void CloseReadStreams(const nsID& aId);

void CloseAllReadStreams();

void CloseAllReadStreamsWithoutReporting();
Expand Down
7 changes: 0 additions & 7 deletions dom/cache/StreamList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,6 @@ void StreamList::NoteClosedAll() {
}
}

void StreamList::Close(const nsID& aId) {
NS_ASSERT_OWNINGTHREAD(StreamList);
if (mStreamControl) {
mStreamControl->Close(aId);
}
}

void StreamList::CloseAll() {
NS_ASSERT_OWNINGTHREAD(StreamList);
if (mStreamControl) {
Expand Down
1 change: 0 additions & 1 deletion dom/cache/StreamList.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class StreamList final : public Context::Activity,

void NoteClosed(const nsID& aId);
void NoteClosedAll();
void Close(const nsID& aId);
void CloseAll();

// Context::Activity methods
Expand Down

0 comments on commit 3ed5b7a

Please sign in to comment.