зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1594166 - Don't add a manual ref when constructing FileChannelChild, since it's a refcounted IPDL class. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D51904 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
f96632cb82
Коммит
0d8858e71c
|
@ -15,8 +15,7 @@ namespace net {
|
||||||
|
|
||||||
NS_IMPL_ISUPPORTS_INHERITED(FileChannelChild, nsFileChannel, nsIChildChannel)
|
NS_IMPL_ISUPPORTS_INHERITED(FileChannelChild, nsFileChannel, nsIChildChannel)
|
||||||
|
|
||||||
FileChannelChild::FileChannelChild(nsIURI* uri)
|
FileChannelChild::FileChannelChild(nsIURI* uri) : nsFileChannel(uri) {}
|
||||||
: nsFileChannel(uri), mIPCOpen(false) {}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
FileChannelChild::ConnectParent(uint32_t id) {
|
FileChannelChild::ConnectParent(uint32_t id) {
|
||||||
|
@ -29,8 +28,6 @@ FileChannelChild::ConnectParent(uint32_t id) {
|
||||||
if (!gNeckoChild->SendPFileChannelConstructor(this, id)) {
|
if (!gNeckoChild->SendPFileChannelConstructor(this, id)) {
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
AddIPDLReference();
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,22 +42,12 @@ FileChannelChild::CompleteRedirectSetup(nsIStreamListener* listener,
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mIPCOpen) {
|
if (CanSend()) {
|
||||||
Unused << Send__delete__(this);
|
Unused << Send__delete__(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileChannelChild::AddIPDLReference() {
|
|
||||||
AddRef(); // Released in NeckoChild::DeallocPFileChannelChild.
|
|
||||||
mIPCOpen = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void FileChannelChild::ActorDestroy(ActorDestroyReason why) {
|
|
||||||
MOZ_ASSERT(mIPCOpen);
|
|
||||||
mIPCOpen = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace net
|
} // namespace net
|
||||||
} // namespace mozilla
|
} // namespace mozilla
|
||||||
|
|
|
@ -25,16 +25,8 @@ class FileChannelChild : public nsFileChannel,
|
||||||
NS_DECL_ISUPPORTS_INHERITED
|
NS_DECL_ISUPPORTS_INHERITED
|
||||||
NS_DECL_NSICHILDCHANNEL
|
NS_DECL_NSICHILDCHANNEL
|
||||||
|
|
||||||
protected:
|
|
||||||
virtual void ActorDestroy(ActorDestroyReason why) override;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
~FileChannelChild() = default;
|
~FileChannelChild() = default;
|
||||||
;
|
|
||||||
|
|
||||||
void AddIPDLReference();
|
|
||||||
|
|
||||||
bool mIPCOpen;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace net
|
} // namespace net
|
||||||
|
|
Загрузка…
Ссылка в новой задаче