Bug 1405697 - Move HTTP_REQUESTED_RANGE_NOT_SATISFIABLE_CODE to the file it's used in. r=jwwang draft
authorChris Pearce <cpearce@mozilla.com>
Wed, 04 Oct 2017 16:53:19 +0200
changeset 675486 15aa06371c90e379e31383d2a8527d865944a4c3
parent 675485 ef9600770d6166fece0d1ae038d0b84cc87f1065
child 675487 f25c30d6e9be10549af80d5dfa963ef66abac576
push id83131
push userbmo:cpearce@mozilla.com
push dateThu, 05 Oct 2017 09:31:51 +0000
reviewersjwwang
bugs1405697
milestone58.0a1
Bug 1405697 - Move HTTP_REQUESTED_RANGE_NOT_SATISFIABLE_CODE to the file it's used in. r=jwwang It's only used in ChannelMediaResource.cpp, so it may as well be in there. MozReview-Commit-ID: 5lyeFOoUsUN
dom/media/ChannelMediaResource.cpp
dom/media/MediaResource.h
--- a/dom/media/ChannelMediaResource.cpp
+++ b/dom/media/ChannelMediaResource.cpp
@@ -9,16 +9,17 @@
 #include "nsIAsyncVerifyRedirectCallback.h"
 #include "nsICachingChannel.h"
 #include "nsIClassOfService.h"
 #include "nsIInputStream.h"
 #include "nsNetUtil.h"
 
 static const uint32_t HTTP_PARTIAL_RESPONSE_CODE = 206;
 static const uint32_t HTTP_OK_CODE = 200;
+static const uint32_t HTTP_REQUESTED_RANGE_NOT_SATISFIABLE_CODE = 416;
 
 mozilla::LazyLogModule gMediaResourceLog("MediaResource");
 // Debug logging macro with object pointer and class name.
 #define LOG(msg, ...) MOZ_LOG(gMediaResourceLog, mozilla::LogLevel::Debug, \
   ("%p " msg, this, ##__VA_ARGS__))
 
 namespace mozilla {
 
--- a/dom/media/MediaResource.h
+++ b/dom/media/MediaResource.h
@@ -31,18 +31,16 @@
 // seeked forward is less than this value then a read is
 // done rather than a byte range request.
 //
 // If we assume a 100Mbit connection, and assume reissuing an HTTP seek causes
 // a delay of 200ms, then in that 200ms we could have simply read ahead 2MB. So
 // setting SEEK_VS_READ_THRESHOLD to 1MB sounds reasonable.
 static const int64_t SEEK_VS_READ_THRESHOLD = 1 * 1024 * 1024;
 
-static const uint32_t HTTP_REQUESTED_RANGE_NOT_SATISFIABLE_CODE = 416;
-
 class nsIHttpChannel;
 class nsIPrincipal;
 
 namespace mozilla {
 
 // Represents a section of contiguous media, with a start and end offset.
 // Used to denote ranges of data which are cached.