Bug 1310127 - Part 17: Use MOZ_MUST_USE in netwerk/protocol/http r=smaug

MozReview-Commit-ID: 5gvVZtsa3yS
This commit is contained in:
Wei-Cheng Pan
2016-12-20 11:49:32 +08:00
parent b4a72bdc11
commit 7a678cdad2
22 changed files with 144 additions and 85 deletions

View File

@@ -516,7 +516,7 @@ HTMLMediaElement::MediaLoadListener::OnStartRequest(nsIRequest* aRequest,
if (hc && NS_SUCCEEDED(hc->GetRequestSucceeded(&succeeded)) && !succeeded) {
element->NotifyLoadError();
uint32_t responseStatus = 0;
hc->GetResponseStatus(&responseStatus);
Unused << hc->GetResponseStatus(&responseStatus);
nsAutoString code;
code.AppendInt(responseStatus);
nsAutoString src;
@@ -1168,9 +1168,10 @@ public:
// Use a byte range request from the start of the resource.
// This enables us to detect if the stream supports byte range
// requests, and therefore seeking, early.
hc->SetRequestHeader(NS_LITERAL_CSTRING("Range"),
NS_LITERAL_CSTRING("bytes=0-"),
false);
rv = hc->SetRequestHeader(NS_LITERAL_CSTRING("Range"),
NS_LITERAL_CSTRING("bytes=0-"),
false);
MOZ_ASSERT(NS_SUCCEEDED(rv));
aElement->SetRequestHeaders(hc);
}
@@ -6454,12 +6455,15 @@ void HTMLMediaElement::SetRequestHeaders(nsIHttpChannel* aChannel)
// and a length spec in the container are not present either) and from seeking.
// So, disable the standard "Accept-Encoding: gzip,deflate" that we usually send.
// See bug 614760.
aChannel->SetRequestHeader(NS_LITERAL_CSTRING("Accept-Encoding"),
EmptyCString(), false);
DebugOnly<nsresult> rv =
aChannel->SetRequestHeader(NS_LITERAL_CSTRING("Accept-Encoding"),
EmptyCString(), false);
MOZ_ASSERT(NS_SUCCEEDED(rv));
// Set the Referer header
aChannel->SetReferrerWithPolicy(OwnerDoc()->GetDocumentURI(),
OwnerDoc()->GetReferrerPolicy());
rv = aChannel->SetReferrerWithPolicy(OwnerDoc()->GetDocumentURI(),
OwnerDoc()->GetReferrerPolicy());
MOZ_ASSERT(NS_SUCCEEDED(rv));
}
void HTMLMediaElement::FireTimeUpdate(bool aPeriodic)