Bug 1615155 - Don't generate default `Recv__delete__` if there are args. r=nika

The default method implementations cause problems when trying to
override them with different types in a direct call class.

For the `Recv__delete__` case there's a simple solution: omit it if
there are any arguments, because it doesn't make much sense to specify
arguments and then completely ignore them, and the no-arg case isn't a
problem for overriding.

Differential Revision: https://phabricator.services.mozilla.com/D62977

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jed Davis 2020-02-18 20:46:21 +00:00
Родитель 240c4b930a
Коммит ee171b6406
14 изменённых файлов: 26 добавлений и 27 удалений

4
dom/cache/CacheOpChild.h поставляемый
Просмотреть файл

@ -38,8 +38,8 @@ class CacheOpChild final : public PCacheOpChild,
// PCacheOpChild methods
virtual void ActorDestroy(ActorDestroyReason aReason) override;
virtual mozilla::ipc::IPCResult Recv__delete__(
ErrorResult&& aRv, const CacheOpResult& aResult) override;
mozilla::ipc::IPCResult Recv__delete__(ErrorResult&& aRv,
const CacheOpResult& aResult);
// ActorChild methods
virtual void StartDestroy() override;

Просмотреть файл

@ -22,8 +22,7 @@ class FileCreatorChild final : public mozilla::dom::PFileCreatorChild {
void SetPromise(Promise* aPromise);
private:
mozilla::ipc::IPCResult Recv__delete__(
const FileCreationResult& aResult) override;
mozilla::ipc::IPCResult Recv__delete__(const FileCreationResult& aResult);
void ActorDestroy(ActorDestroyReason aWhy) override;

Просмотреть файл

@ -39,8 +39,7 @@ class TemporaryIPCBlobChild final : public PTemporaryIPCBlobChild {
mozilla::ipc::IPCResult RecvFileDesc(const FileDescriptor& aFD);
mozilla::ipc::IPCResult Recv__delete__(
const IPCBlobOrError& aBlobOrError) override;
mozilla::ipc::IPCResult Recv__delete__(const IPCBlobOrError& aBlobOrError);
void ActorDestroy(ActorDestroyReason aWhy) override;

Просмотреть файл

@ -264,7 +264,7 @@ class BackgroundFactoryRequestChild final
void ActorDestroy(ActorDestroyReason aWhy) override;
mozilla::ipc::IPCResult Recv__delete__(
const FactoryRequestResponse& aResponse) override;
const FactoryRequestResponse& aResponse);
mozilla::ipc::IPCResult RecvPermissionChallenge(
const PrincipalInfo& aPrincipalInfo);
@ -387,7 +387,7 @@ class BackgroundDatabaseRequestChild final
public:
// IPDL methods are only called by IPDL.
mozilla::ipc::IPCResult Recv__delete__(
const DatabaseRequestResponse& aResponse) override;
const DatabaseRequestResponse& aResponse);
};
class BackgroundVersionChangeTransactionChild;
@ -623,8 +623,7 @@ class BackgroundRequestChild final : public BackgroundRequestChildBase,
// IPDL methods are only called by IPDL.
void ActorDestroy(ActorDestroyReason aWhy) override;
mozilla::ipc::IPCResult Recv__delete__(
const RequestResponse& aResponse) override;
mozilla::ipc::IPCResult Recv__delete__(const RequestResponse& aResponse);
mozilla::ipc::IPCResult RecvPreprocess(const PreprocessParams& aParams);
};
@ -834,8 +833,7 @@ class BackgroundFileRequestChild final : public PBackgroundFileRequestChild {
// IPDL methods are only called by IPDL.
void ActorDestroy(ActorDestroyReason aWhy) override;
mozilla::ipc::IPCResult Recv__delete__(
const FileRequestResponse& aResponse) override;
mozilla::ipc::IPCResult Recv__delete__(const FileRequestResponse& aResponse);
mozilla::ipc::IPCResult RecvProgress(const uint64_t& aProgress,
const uint64_t& aProgressMax);

Просмотреть файл

@ -24,7 +24,7 @@ class URLClassifierChild : public PURLClassifierChild {
}
mozilla::ipc::IPCResult Recv__delete__(const Maybe<ClassifierInfo>& aInfo,
const nsresult& aResult) override {
const nsresult& aResult) {
MOZ_ASSERT(mCallback);
if (aInfo.isSome()) {
mCallback->OnClassifyComplete(aResult, aInfo.ref().list(),
@ -48,7 +48,7 @@ class URLClassifierLocalChild : public PURLClassifierLocalChild {
}
mozilla::ipc::IPCResult Recv__delete__(
nsTArray<URLClassifierLocalResult>&& aResults) override {
nsTArray<URLClassifierLocalResult>&& aResults) {
nsTArray<RefPtr<nsIUrlClassifierFeatureResult>> finalResults;
nsTArray<URLClassifierLocalResult> results = std::move(aResults);

Просмотреть файл

@ -30,8 +30,7 @@ class StreamNotifyChild : public PStreamNotifyChild {
void NPP_URLNotify(NPReason reason);
private:
virtual mozilla::ipc::IPCResult Recv__delete__(
const NPReason& reason) override;
mozilla::ipc::IPCResult Recv__delete__(const NPReason& reason);
mozilla::ipc::IPCResult RecvRedirectNotify(const nsCString& url,
const int32_t& status);

Просмотреть файл

@ -71,8 +71,7 @@ class PresentationRequestChild final : public PPresentationRequestChild {
virtual void ActorDestroy(ActorDestroyReason aWhy) override;
virtual mozilla::ipc::IPCResult Recv__delete__(
const nsresult& aResult) override;
mozilla::ipc::IPCResult Recv__delete__(const nsresult& aResult);
mozilla::ipc::IPCResult RecvNotifyRequestUrlSelected(const nsString& aUrl);

Просмотреть файл

@ -22,8 +22,7 @@ class EndpointForReportChild final : public PEndpointForReportChild {
void Initialize(const ReportDeliver::ReportData& aReportData);
mozilla::ipc::IPCResult Recv__delete__(
const nsCString& aEndpointURL) override;
mozilla::ipc::IPCResult Recv__delete__(const nsCString& aEndpointURL);
private:
ReportDeliver::ReportData mReportData;

Просмотреть файл

@ -55,7 +55,7 @@ class FetchEventOpChild final : public PFetchEventOpChild {
IPCFetchEventRespondWithResult&& aResult);
mozilla::ipc::IPCResult Recv__delete__(
const ServiceWorkerFetchEventOpResult& aResult) override;
const ServiceWorkerFetchEventOpResult& aResult);
void ActorDestroy(ActorDestroyReason) override;

Просмотреть файл

@ -44,7 +44,7 @@ class FetchEventOpProxyParent final : public PFetchEventOpProxyParent {
const IPCFetchEventRespondWithResult& aResult);
mozilla::ipc::IPCResult Recv__delete__(
const ServiceWorkerFetchEventOpResult& aResult) override;
const ServiceWorkerFetchEventOpResult& aResult);
void ActorDestroy(ActorDestroyReason) override;

Просмотреть файл

@ -3368,7 +3368,14 @@ class _GenerateProtocolActorCode(ipdl.ast.Visitor):
ret=Type('mozilla::ipc::IPCResult'),
methodspec=MethodSpec.VIRTUAL)
if isctor or isdtor:
# These method implementations cause problems when trying to
# override them with different types in a direct call class.
#
# For the `isdtor` case there's a simple solution: it doesn't
# make much sense to specify arguments and then completely
# ignore them, and the no-arg case isn't a problem for
# overriding.
if isctor or (isdtor and not md.inParams):
defaultRecv = MethodDefn(recvDecl)
defaultRecv.addcode('return IPC_OK();\n')
self.cls.addstmt(defaultRecv)

Просмотреть файл

@ -52,7 +52,7 @@ class TestShellCommandParent : public PTestShellCommandParent {
void ActorDestroy(ActorDestroyReason why) override;
mozilla::ipc::IPCResult Recv__delete__(const nsString& aResponse) override {
mozilla::ipc::IPCResult Recv__delete__(const nsString& aResponse) {
if (!ExecuteCallback(aResponse)) {
return IPC_FAIL_NO_REASON(this);
}

Просмотреть файл

@ -28,7 +28,7 @@ class ScriptCacheParent final : public PScriptCacheParent {
: mWantCacheData(wantCacheData) {}
protected:
virtual IPCResult Recv__delete__(nsTArray<ScriptData>&& scripts) override;
IPCResult Recv__delete__(nsTArray<ScriptData>&& scripts);
virtual void ActorDestroy(ActorDestroyReason aWhy) override;

Просмотреть файл

@ -33,8 +33,7 @@ class ClassifierDummyChannelChild final : public PClassifierDummyChannelChild {
void Initialize(nsIHttpChannel* aChannel, nsIURI* aURI, bool aIsThirdParty,
const std::function<void(bool)>& aCallback);
mozilla::ipc::IPCResult Recv__delete__(
const uint32_t& aClassificationFlags) override;
mozilla::ipc::IPCResult Recv__delete__(const uint32_t& aClassificationFlags);
nsCOMPtr<nsIHttpChannel> mChannel;
nsCOMPtr<nsIURI> mURI;