diff --git a/dom/cache/CacheOpParent.cpp b/dom/cache/CacheOpParent.cpp index 288eb5618bbb..6c88864c94b8 100644 --- a/dom/cache/CacheOpParent.cpp +++ b/dom/cache/CacheOpParent.cpp @@ -6,6 +6,7 @@ #include "mozilla/dom/cache/CacheOpParent.h" +#include "mozilla/ErrorResult.h" #include "mozilla/StaticPrefs_browser.h" #include "mozilla/Unused.h" #include "mozilla/dom/cache/AutoUtils.h" @@ -46,8 +47,8 @@ void CacheOpParent::Execute(const SafeRefPtr& aManagerId) { auto managerOrErr = cache::Manager::AcquireCreateIfNonExistent(aManagerId); if (NS_WARN_IF(managerOrErr.isErr())) { - ErrorResult result(managerOrErr.unwrapErr()); - Unused << Send__delete__(this, std::move(result), void_t()); + (void)Send__delete__(this, CopyableErrorResult(managerOrErr.unwrapErr()), + void_t()); return; } @@ -128,8 +129,7 @@ void CacheOpParent::OnPrincipalVerified( mVerifier = nullptr; if (NS_WARN_IF(NS_FAILED(aRv))) { - ErrorResult result(aRv); - Unused << Send__delete__(this, std::move(result), void_t()); + (void)Send__delete__(this, CopyableErrorResult(aRv), void_t()); return; } @@ -147,7 +147,7 @@ void CacheOpParent::OnOpComplete(ErrorResult&& aRv, // Never send an op-specific result if we have an error. Instead, send // void_t() to ensure that we don't leak actors on the child side. if (NS_WARN_IF(aRv.Failed())) { - Unused << Send__delete__(this, std::move(aRv), void_t()); + (void)Send__delete__(this, CopyableErrorResult(std::move(aRv)), void_t()); return; } @@ -155,7 +155,7 @@ void CacheOpParent::OnOpComplete(ErrorResult&& aRv, ProcessCrossOriginResourcePolicyHeader(aRv, aStreamInfo->mSavedResponseList); if (NS_WARN_IF(aRv.Failed())) { - Unused << Send__delete__(this, std::move(aRv), void_t()); + (void)Send__delete__(this, CopyableErrorResult(std::move(aRv)), void_t()); return; } } @@ -190,7 +190,8 @@ void CacheOpParent::OnOpComplete(ErrorResult&& aRv, } } - Unused << Send__delete__(this, std::move(aRv), result.SendAsOpResult()); + (void)Send__delete__(this, CopyableErrorResult(std::move(aRv)), + result.SendAsOpResult()); } already_AddRefed CacheOpParent::DeserializeCacheStream( diff --git a/dom/cache/CacheStorageParent.cpp b/dom/cache/CacheStorageParent.cpp index 5a7c5774cb12..13eb0eb1809c 100644 --- a/dom/cache/CacheStorageParent.cpp +++ b/dom/cache/CacheStorageParent.cpp @@ -6,6 +6,7 @@ #include "mozilla/dom/cache/CacheStorageParent.h" +#include "mozilla/ErrorResult.h" #include "mozilla/Unused.h" #include "mozilla/dom/cache/ActorUtils.h" #include "mozilla/dom/cache/CacheOpParent.h" @@ -89,10 +90,8 @@ mozilla::ipc::IPCResult CacheStorageParent::RecvPCacheOpConstructor( } if (NS_WARN_IF(NS_FAILED(mVerifiedStatus))) { - ErrorResult result(mVerifiedStatus); - - QM_WARNONLY_TRY(OkIf( - CacheOpParent::Send__delete__(actor, std::move(result), void_t()))); + QM_WARNONLY_TRY(OkIf(CacheOpParent::Send__delete__( + actor, CopyableErrorResult(mVerifiedStatus), void_t()))); return IPC_OK(); } diff --git a/dom/cache/PCacheOp.ipdl b/dom/cache/PCacheOp.ipdl index 909fb2be7391..a8660ec7bc7e 100644 --- a/dom/cache/PCacheOp.ipdl +++ b/dom/cache/PCacheOp.ipdl @@ -10,7 +10,7 @@ include CacheTypes; include "ipc/ErrorIPCUtils.h"; -[MoveOnly] using mozilla::ErrorResult from "mozilla/ErrorResult.h"; +using mozilla::CopyableErrorResult from "mozilla/ErrorResult.h"; namespace mozilla { namespace dom { @@ -21,7 +21,7 @@ protocol PCacheOp manager PCache or PCacheStorage; child: - async __delete__(ErrorResult aRv, CacheOpResult aResult); + async __delete__(CopyableErrorResult aRv, CacheOpResult aResult); }; } // namespace cache