Bug 1310127 - Part 14: Use MOZ_MUST_USE in netwerk/protocol/http r?tnikkel
MozReview-Commit-ID: Gvv80wYQ7JI
--- a/image/imgLoader.cpp
+++ b/image/imgLoader.cpp
@@ -826,25 +826,28 @@ NewImageChannel(nsIChannel** aResult,
aLoadingPrincipal,
aURI,
/* aInheritForAboutBlank */ false,
/* aForceInherit */ false);
// Initialize HTTP-specific attributes
newHttpChannel = do_QueryInterface(*aResult);
if (newHttpChannel) {
- newHttpChannel->SetRequestHeader(NS_LITERAL_CSTRING("Accept"),
- aAcceptHeader,
- false);
+ rv = newHttpChannel->SetRequestHeader(NS_LITERAL_CSTRING("Accept"),
+ aAcceptHeader,
+ false);
+ MOZ_ASSERT(NS_SUCCEEDED(rv));
nsCOMPtr<nsIHttpChannelInternal> httpChannelInternal =
do_QueryInterface(newHttpChannel);
NS_ENSURE_TRUE(httpChannelInternal, NS_ERROR_UNEXPECTED);
- httpChannelInternal->SetDocumentURI(aInitialDocumentURI);
- newHttpChannel->SetReferrerWithPolicy(aReferringURI, aReferrerPolicy);
+ rv = httpChannelInternal->SetDocumentURI(aInitialDocumentURI);
+ MOZ_ASSERT(NS_SUCCEEDED(rv));
+ rv = newHttpChannel->SetReferrerWithPolicy(aReferringURI, aReferrerPolicy);
+ MOZ_ASSERT(NS_SUCCEEDED(rv));
}
// Image channels are loaded by default with reduced priority.
nsCOMPtr<nsISupportsPriority> p = do_QueryInterface(*aResult);
if (p) {
uint32_t priority = nsISupportsPriority::PRIORITY_LOW;
if (aLoadFlags & nsIRequest::LOAD_BACKGROUND) {
--- a/image/imgRequest.cpp
+++ b/image/imgRequest.cpp
@@ -594,27 +594,27 @@ imgRequest::SetCacheValidation(imgCacheE
}
// Determine whether the cache entry must be revalidated when we try to use
// it. Currently, only HTTP specifies this information...
nsCOMPtr<nsIHttpChannel> httpChannel(do_QueryInterface(aRequest));
if (httpChannel) {
bool bMustRevalidate = false;
- httpChannel->IsNoStoreResponse(&bMustRevalidate);
+ Unused << httpChannel->IsNoStoreResponse(&bMustRevalidate);
if (!bMustRevalidate) {
- httpChannel->IsNoCacheResponse(&bMustRevalidate);
+ Unused << httpChannel->IsNoCacheResponse(&bMustRevalidate);
}
if (!bMustRevalidate) {
nsAutoCString cacheHeader;
- httpChannel->GetResponseHeader(NS_LITERAL_CSTRING("Cache-Control"),
- cacheHeader);
+ Unused << httpChannel->GetResponseHeader(NS_LITERAL_CSTRING("Cache-Control"),
+ cacheHeader);
if (PL_strcasestr(cacheHeader.get(), "must-revalidate")) {
bMustRevalidate = true;
}
}
// Cache entries default to not needing to validate. We ensure that
// multiple calls to this function don't override an earlier decision to
// validate by making validation a one-way decision.