Bug 1529942 - part 1 - move initialization of ExternalHelperAppParent into Recv*; r=qdot

Alloc methods can't take arguments by move reference, whereas Recv
methods can, and we'd like to take OptionalLoadInfoArgs (at least) by
move reference.  Since Init is infallible anyway, it doesn't really
matter where we do it, so move it to this separate method to pave the
way for rvalue reference OptionalLoadInfoArgs.
This commit is contained in:
Nathan Froyd 2019-02-25 13:13:43 -05:00
parent ac968578cf
commit f71c238411
2 changed files with 19 additions and 1 deletions

View File

@ -3608,7 +3608,6 @@ PExternalHelperAppParent* ContentParent::AllocPExternalHelperAppParent(
uri, aLoadInfoArgs, aContentLength, aWasFileChannel, aContentDisposition,
aContentDispositionHint, aContentDispositionFilename);
parent->AddRef();
parent->Init(aMimeContentType, aForceSave, aReferrer, aBrowser);
return parent;
}
@ -3620,6 +3619,17 @@ bool ContentParent::DeallocPExternalHelperAppParent(
return true;
}
mozilla::ipc::IPCResult ContentParent::RecvPExternalHelperAppConstructor(
PExternalHelperAppParent* actor, const OptionalURIParams& uri,
const OptionalLoadInfoArgs& loadInfoArgs, const nsCString& aMimeContentType,
const nsCString& aContentDisposition, const uint32_t& aContentDispositionHint,
const nsString& aContentDispositionFilename, const bool& aForceSave,
const int64_t& aContentLength, const bool& aWasFileChannel,
const OptionalURIParams& aReferrer, PBrowserParent* aBrowser) {
actor->Init(aMimeContentType, aForceSave, aReferrer, aBrowser);
return IPC_OK();
}
PHandlerServiceParent* ContentParent::AllocPHandlerServiceParent() {
HandlerServiceParent* actor = new HandlerServiceParent();
actor->AddRef();

View File

@ -909,6 +909,14 @@ class ContentParent final : public PContentParent,
bool DeallocPExternalHelperAppParent(PExternalHelperAppParent* aService);
mozilla::ipc::IPCResult RecvPExternalHelperAppConstructor(
PExternalHelperAppParent* actor, const OptionalURIParams& uri,
const OptionalLoadInfoArgs& loadInfoArgs, const nsCString& aMimeContentType,
const nsCString& aContentDisposition, const uint32_t& aContentDispositionHint,
const nsString& aContentDispositionFilename, const bool& aForceSave,
const int64_t& aContentLength, const bool& aWasFileChannel,
const OptionalURIParams& aReferrer, PBrowserParent* aBrowser) override;
PHandlerServiceParent* AllocPHandlerServiceParent();
bool DeallocPHandlerServiceParent(PHandlerServiceParent*);