Bug 1304633 - Treating resources as finite when the response code is 206. r=cpearce
authorJW Wang <jwwang@mozilla.com>
Thu, 22 Sep 2016 15:15:01 +0800
changeset 315584 d2cce59a6d01a036f12d44b17ee23f6f582b873e
parent 315583 c419c4807be68a9dab3f781908cbd9b68f9bdea6
child 315585 f52d02de70b2f5d9571a1d107cb155dd21dca49f
push id32665
push userjwwang@mozilla.com
push dateThu, 29 Sep 2016 02:20:54 +0000
treeherderautoland@d2cce59a6d01 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs1304633
milestone52.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1304633 - Treating resources as finite when the response code is 206. r=cpearce MozReview-Commit-ID: 13GF2E5IwSs
dom/media/MediaResource.cpp
--- a/dom/media/MediaResource.cpp
+++ b/dom/media/MediaResource.cpp
@@ -217,17 +217,19 @@ ChannelMediaResource::OnStartRequest(nsI
     hc->GetResponseHeader(NS_LITERAL_CSTRING("Accept-Ranges"),
                           ranges);
     bool acceptsRanges = ranges.EqualsLiteral("bytes");
     // True if this channel will not return an unbounded amount of data
     bool dataIsBounded = false;
 
     int64_t contentLength = -1;
     hc->GetContentLength(&contentLength);
-    if (contentLength >= 0 && responseStatus == HTTP_OK_CODE) {
+    if (contentLength >= 0 &&
+        (responseStatus == HTTP_OK_CODE ||
+         responseStatus == HTTP_PARTIAL_RESPONSE_CODE)) {
       // "OK" status means Content-Length is for the whole resource.
       // Since that's bounded, we know we have a finite-length resource.
       dataIsBounded = true;
     }
 
     // Assume Range requests have a bounded upper limit unless the
     // Content-Range header tells us otherwise.
     bool boundedSeekLimit = true;