mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-26 04:09:50 +00:00
Bug 1655115 - Remove unused code paths leading to dom::cache::StreamControl::CloseReadStreams() r=dom-workers-and-storage-reviewers,ttung
Differential Revision: https://phabricator.services.mozilla.com/D85364
This commit is contained in:
parent
57df1c675c
commit
3ed5b7a070
6
dom/cache/CacheStreamControlChild.cpp
vendored
6
dom/cache/CacheStreamControlChild.cpp
vendored
@ -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();
|
||||
|
11
dom/cache/CacheStreamControlParent.cpp
vendored
11
dom/cache/CacheStreamControlParent.cpp
vendored
@ -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();
|
||||
@ -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();
|
||||
|
2
dom/cache/CacheStreamControlParent.h
vendored
2
dom/cache/CacheStreamControlParent.h
vendored
@ -31,7 +31,6 @@ class CacheStreamControlParent final : public PCacheStreamControlParent,
|
||||
CacheStreamControlParent();
|
||||
|
||||
void SetStreamList(SafeRefPtr<StreamList> aStreamList);
|
||||
void Close(const nsID& aId);
|
||||
void CloseAll();
|
||||
void Shutdown();
|
||||
|
||||
@ -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
|
||||
|
1
dom/cache/PCacheStreamControl.ipdl
vendored
1
dom/cache/PCacheStreamControl.ipdl
vendored
@ -23,7 +23,6 @@ parent:
|
||||
async NoteClosed(nsID aStreamId);
|
||||
|
||||
child:
|
||||
async Close(nsID aStreamId);
|
||||
async CloseAll();
|
||||
async __delete__();
|
||||
};
|
||||
|
7
dom/cache/ReadStream.cpp
vendored
7
dom/cache/ReadStream.cpp
vendored
@ -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
|
||||
@ -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;
|
||||
|
2
dom/cache/ReadStream.h
vendored
2
dom/cache/ReadStream.h
vendored
@ -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);
|
||||
|
18
dom/cache/StreamControl.cpp
vendored
18
dom/cache/StreamControl.cpp
vendored
@ -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();
|
||||
|
||||
|
2
dom/cache/StreamControl.h
vendored
2
dom/cache/StreamControl.h
vendored
@ -54,8 +54,6 @@ class StreamControl {
|
||||
protected:
|
||||
~StreamControl();
|
||||
|
||||
void CloseReadStreams(const nsID& aId);
|
||||
|
||||
void CloseAllReadStreams();
|
||||
|
||||
void CloseAllReadStreamsWithoutReporting();
|
||||
|
7
dom/cache/StreamList.cpp
vendored
7
dom/cache/StreamList.cpp
vendored
@ -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) {
|
||||
|
1
dom/cache/StreamList.h
vendored
1
dom/cache/StreamList.h
vendored
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user