mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
Bug 1678988 - Stopped passing raw ErrorResult over IPC r=dom-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D190542
This commit is contained in:
parent
fa8f7f9a3f
commit
ddf00d0232
15
dom/cache/CacheOpParent.cpp
vendored
15
dom/cache/CacheOpParent.cpp
vendored
@ -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<ManagerId>& 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<nsIInputStream> CacheOpParent::DeserializeCacheStream(
|
||||
|
7
dom/cache/CacheStorageParent.cpp
vendored
7
dom/cache/CacheStorageParent.cpp
vendored
@ -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();
|
||||
}
|
||||
|
||||
|
4
dom/cache/PCacheOp.ipdl
vendored
4
dom/cache/PCacheOp.ipdl
vendored
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user