mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-01 05:48:26 +00:00
Bug 1570369 - Part 12: Use IPDL refcounted for PDataChannel, r=mayhemer
Differential Revision: https://phabricator.services.mozilla.com/D40257 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
d678a3d0da
commit
cac925ef9d
@ -220,17 +220,6 @@ bool NeckoChild::DeallocPWebSocketEventListenerChild(
|
||||
return true;
|
||||
}
|
||||
|
||||
PDataChannelChild* NeckoChild::AllocPDataChannelChild(
|
||||
const uint32_t& channelId) {
|
||||
MOZ_ASSERT_UNREACHABLE("Should never get here");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool NeckoChild::DeallocPDataChannelChild(PDataChannelChild* child) {
|
||||
static_cast<DataChannelChild*>(child)->Release();
|
||||
return true;
|
||||
}
|
||||
|
||||
PFileChannelChild* NeckoChild::AllocPFileChannelChild(
|
||||
const uint32_t& channelId) {
|
||||
MOZ_ASSERT_UNREACHABLE("Should never get here");
|
||||
|
@ -65,8 +65,6 @@ class NeckoChild : public PNeckoChild {
|
||||
const nsCString& aHost, const OriginAttributes& aOriginAttributes,
|
||||
const uint32_t& aFlags);
|
||||
bool DeallocPDNSRequestChild(PDNSRequestChild*);
|
||||
PDataChannelChild* AllocPDataChannelChild(const uint32_t& channelId);
|
||||
bool DeallocPDataChannelChild(PDataChannelChild* child);
|
||||
PFileChannelChild* AllocPFileChannelChild(const uint32_t& channelId);
|
||||
bool DeallocPFileChannelChild(PFileChannelChild* child);
|
||||
PSimpleChannelChild* AllocPSimpleChannelChild(const uint32_t& channelId);
|
||||
|
@ -468,16 +468,10 @@ bool NeckoParent::DeallocPWebSocketEventListenerParent(
|
||||
return true;
|
||||
}
|
||||
|
||||
PDataChannelParent* NeckoParent::AllocPDataChannelParent(
|
||||
already_AddRefed<PDataChannelParent> NeckoParent::AllocPDataChannelParent(
|
||||
const uint32_t& channelId) {
|
||||
RefPtr<DataChannelParent> p = new DataChannelParent();
|
||||
return p.forget().take();
|
||||
}
|
||||
|
||||
bool NeckoParent::DeallocPDataChannelParent(PDataChannelParent* actor) {
|
||||
RefPtr<DataChannelParent> p =
|
||||
dont_AddRef(static_cast<DataChannelParent*>(actor));
|
||||
return true;
|
||||
return p.forget();
|
||||
}
|
||||
|
||||
mozilla::ipc::IPCResult NeckoParent::RecvPDataChannelConstructor(
|
||||
|
@ -164,8 +164,8 @@ class NeckoParent : public PNeckoParent {
|
||||
const uint64_t& aInnerWindowID);
|
||||
bool DeallocPWebSocketEventListenerParent(PWebSocketEventListenerParent*);
|
||||
|
||||
PDataChannelParent* AllocPDataChannelParent(const uint32_t& channelId);
|
||||
bool DeallocPDataChannelParent(PDataChannelParent* parent);
|
||||
already_AddRefed<PDataChannelParent> AllocPDataChannelParent(
|
||||
const uint32_t& channelId);
|
||||
|
||||
virtual mozilla::ipc::IPCResult RecvPDataChannelConstructor(
|
||||
PDataChannelParent* aActor, const uint32_t& channelId) override;
|
||||
|
@ -11,7 +11,7 @@ include URIParams;
|
||||
namespace mozilla {
|
||||
namespace net {
|
||||
|
||||
async protocol PDataChannel
|
||||
async refcounted protocol PDataChannel
|
||||
{
|
||||
manager PNecko;
|
||||
|
||||
|
@ -31,7 +31,7 @@ DataChannelChild::ConnectParent(uint32_t aId) {
|
||||
}
|
||||
|
||||
// IPC now has a ref to us.
|
||||
AddIPDLReference();
|
||||
mIPCOpen = true;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -51,11 +51,6 @@ DataChannelChild::CompleteRedirectSetup(nsIStreamListener* aListener,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void DataChannelChild::AddIPDLReference() {
|
||||
AddRef(); // Released in NeckoChild::DeallocPDataChannelChild.
|
||||
mIPCOpen = true;
|
||||
}
|
||||
|
||||
void DataChannelChild::ActorDestroy(ActorDestroyReason why) {
|
||||
MOZ_ASSERT(mIPCOpen);
|
||||
mIPCOpen = false;
|
||||
|
@ -31,8 +31,6 @@ class DataChannelChild : public nsDataChannel,
|
||||
private:
|
||||
~DataChannelChild() = default;
|
||||
|
||||
void AddIPDLReference();
|
||||
|
||||
bool mIPCOpen;
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user