Bug 1157754 part 2. Convert consumers of ErrorResult::ClearMessage() to the new better APIs we have for suppressing exceptions on ErrorResult. r=bkelly

This commit is contained in:
Boris Zbarsky 2015-04-26 22:38:17 -04:00
parent 948fb6f6e6
commit 4fd0c4fc34
4 changed files with 8 additions and 7 deletions

View File

@ -195,7 +195,7 @@ CacheOpParent::OnOpComplete(ErrorResult&& aRv, const CacheOpResult& aResult,
// void_t() to ensure that we don't leak actors on the child side.
if (aRv.Failed()) {
unused << Send__delete__(this, aRv, void_t());
aRv.ClearMessage(); // This may contain a TypeError.
aRv.SuppressException(); // We serialiazed it, as best we could.
return;
}

View File

@ -983,14 +983,14 @@ MatchByVaryHeader(mozIStorageConnection* aConn,
nsAutoCString queryValue;
queryHeaders->Get(header, queryValue, errorResult);
if (errorResult.Failed()) {
errorResult.ClearMessage();
errorResult.SuppressException();
MOZ_ASSERT(queryValue.IsEmpty());
}
nsAutoCString cachedValue;
cachedHeaders->Get(header, cachedValue, errorResult);
if (errorResult.Failed()) {
errorResult.ClearMessage();
errorResult.SuppressException();
MOZ_ASSERT(cachedValue.IsEmpty());
}

View File

@ -160,7 +160,8 @@ FetchPut::~FetchPut()
MOZ_ASSERT(!mListener);
mManager->RemoveListener(this);
mManager->ReleaseCacheId(mCacheId);
mResult.ClearMessage(); // This may contain a TypeError.
mResult.SuppressException(); // XXXbz should we really be ending up here with
// a failed mResult we never reported to anyone?
}
nsresult
@ -389,14 +390,14 @@ FetchPut::MatchInPutList(const CacheRequest& aRequest,
nsAutoCString value;
requestHeaders->Get(header, value, headerRv);
if (NS_WARN_IF(headerRv.Failed())) {
headerRv.ClearMessage();
headerRv.SuppressException();
MOZ_ASSERT(value.IsEmpty());
}
nsAutoCString cachedValue;
cachedRequestHeaders->Get(header, value, headerRv);
if (NS_WARN_IF(headerRv.Failed())) {
headerRv.ClearMessage();
headerRv.SuppressException();
MOZ_ASSERT(cachedValue.IsEmpty());
}

View File

@ -634,7 +634,7 @@ public:
NS_WARNING(nsPrintfCString("Fetch ignoring illegal header - '%s': '%s'",
PromiseFlatCString(aHeader).get(),
PromiseFlatCString(aValue).get()).get());
result.ClearMessage();
result.SuppressException();
}
return NS_OK;
}