Bug 1310127 - Part 13: Use MOZ_MUST_USE in netwerk/protocol/http r?heycam
MozReview-Commit-ID: 9qpbe86biXz
--- a/layout/style/FontFaceSet.cpp
+++ b/layout/style/FontFaceSet.cpp
@@ -612,30 +612,35 @@ FontFaceSet::StartLoad(gfxUserFontEntry*
fontLoader.get(), aFontFaceSrc->mURI->GetSpecOrDefault().get(),
aFontFaceSrc->mReferrer
? aFontFaceSrc->mReferrer->GetSpecOrDefault().get()
: ""));
}
nsCOMPtr<nsIHttpChannel> httpChannel(do_QueryInterface(channel));
if (httpChannel) {
- httpChannel->SetReferrerWithPolicy(aFontFaceSrc->mReferrer,
- mDocument->GetReferrerPolicy());
+ rv = httpChannel->SetReferrerWithPolicy(aFontFaceSrc->mReferrer,
+ mDocument->GetReferrerPolicy());
+ NS_ENSURE_SUCCESS(rv, rv);
+
nsAutoCString accept("application/font-woff;q=0.9,*/*;q=0.8");
if (Preferences::GetBool(GFX_PREF_WOFF2_ENABLED)) {
accept.Insert(NS_LITERAL_CSTRING("application/font-woff2;q=1.0,"), 0);
}
- httpChannel->SetRequestHeader(NS_LITERAL_CSTRING("Accept"),
- accept, false);
+ rv = httpChannel->SetRequestHeader(NS_LITERAL_CSTRING("Accept"),
+ accept, false);
+ NS_ENSURE_SUCCESS(rv, rv);
+
// For WOFF and WOFF2, we should tell servers/proxies/etc NOT to try
// and apply additional compression at the content-encoding layer
if (aFontFaceSrc->mFormatFlags & (gfxUserFontSet::FLAG_FORMAT_WOFF |
gfxUserFontSet::FLAG_FORMAT_WOFF2)) {
- httpChannel->SetRequestHeader(NS_LITERAL_CSTRING("Accept-Encoding"),
- NS_LITERAL_CSTRING("identity"), false);
+ rv = httpChannel->SetRequestHeader(NS_LITERAL_CSTRING("Accept-Encoding"),
+ NS_LITERAL_CSTRING("identity"), false);
+ NS_ENSURE_SUCCESS(rv, rv);
}
}
nsCOMPtr<nsISupportsPriority> priorityChannel(do_QueryInterface(channel));
if (priorityChannel) {
priorityChannel->AdjustPriority(nsISupportsPriority::PRIORITY_HIGH);
}
rv = NS_NewStreamLoader(getter_AddRefs(streamLoader), fontLoader);
--- a/layout/style/Loader.cpp
+++ b/layout/style/Loader.cpp
@@ -1680,27 +1680,32 @@ Loader::LoadSheet(SheetLoadData* aLoadDa
if (cos) {
cos->AddClassFlags(nsIClassOfService::Leader);
}
}
nsCOMPtr<nsIHttpChannel> httpChannel(do_QueryInterface(channel));
if (httpChannel) {
// Send a minimal Accept header for text/css
- httpChannel->SetRequestHeader(NS_LITERAL_CSTRING("Accept"),
- NS_LITERAL_CSTRING("text/css,*/*;q=0.1"),
- false);
+ rv = httpChannel->SetRequestHeader(NS_LITERAL_CSTRING("Accept"),
+ NS_LITERAL_CSTRING("text/css,*/*;q=0.1"),
+ false);
+ NS_ENSURE_SUCCESS(rv, rv);
+
nsCOMPtr<nsIURI> referrerURI = aLoadData->GetReferrerURI();
- if (referrerURI)
- httpChannel->SetReferrerWithPolicy(referrerURI,
- aLoadData->mSheet->GetReferrerPolicy());
+ if (referrerURI) {
+ rv = httpChannel->SetReferrerWithPolicy(referrerURI,
+ aLoadData->mSheet->GetReferrerPolicy());
+ NS_ENSURE_SUCCESS(rv, rv);
+ }
nsCOMPtr<nsIHttpChannelInternal> internalChannel = do_QueryInterface(httpChannel);
if (internalChannel) {
- internalChannel->SetIntegrityMetadata(sriMetadata.GetIntegrityString());
+ rv = internalChannel->SetIntegrityMetadata(sriMetadata.GetIntegrityString());
+ NS_ENSURE_SUCCESS(rv, rv);
}
// Set the initiator type
nsCOMPtr<nsITimedChannel> timedChannel(do_QueryInterface(httpChannel));
if (timedChannel) {
if (aLoadData->mParentData) {
timedChannel->SetInitiatorType(NS_LITERAL_STRING("css"));
} else {