Bug 1355933: P2. Make arguments const. r?kamidphish draft
authorJean-Yves Avenard <jyavenard@mozilla.com>
Wed, 12 Apr 2017 23:07:11 +0200
changeset 561790 921060a7f73f3142aacae0e6bf6bdb6ed9c90a6d
parent 561789 f1381d4a3013c2c08aba7fc518ac981f707157c9
child 561791 6cdd8fe84bfdc136606fb5cc990396d100f4e0b3
push id53869
push userbmo:jyavenard@mozilla.com
push dateThu, 13 Apr 2017 07:09:28 +0000
reviewerskamidphish
bugs1355933
milestone55.0a1
Bug 1355933: P2. Make arguments const. r?kamidphish MozReview-Commit-ID: AwtpgSJQFE0
dom/media/ADTSDemuxer.cpp
--- a/dom/media/ADTSDemuxer.cpp
+++ b/dom/media/ADTSDemuxer.cpp
@@ -154,21 +154,22 @@ public:
   // Resets the frame header and data.
   void Reset()
   {
     mHeader.Reset();
     mOffset = 0;
   }
 
   // Returns whether the valid
-  bool Parse(int64_t aOffset, uint8_t* aStart, uint8_t* aEnd) {
+  bool Parse(int64_t aOffset, const uint8_t* aStart, const uint8_t* aEnd)
+  {
     MOZ_ASSERT(aStart && aEnd);
 
     bool found = false;
-    uint8_t* ptr = aStart;
+    const uint8_t* ptr = aStart;
     // Require at least 7 bytes of data at the end of the buffer for the minimum
     // ADTS frame header.
     while (ptr < aEnd - 7 && !found) {
       found = mHeader.Parse(ptr);
       ptr++;
     }
 
     mOffset = aOffset + (ptr - aStart) - 1;
@@ -211,17 +212,17 @@ public:
   {
     mFrame.Reset();
   }
 
   // Parses contents of given ByteReader for a valid frame header and returns
   // true if one was found. After returning, the variable passed to
   // 'aBytesToSkip' holds the amount of bytes to be skipped (if any) in order to
   // jump across a large ID3v2 tag spanning multiple buffers.
-  bool Parse(int64_t aOffset, uint8_t* aStart, uint8_t* aEnd)
+  bool Parse(int64_t aOffset, const uint8_t* aStart, const uint8_t* aEnd)
   {
     const bool found = mFrame.Parse(aOffset, aStart, aEnd);
 
     if (mFrame.Length() && !mFirstFrame.Length()) {
       mFirstFrame = mFrame;
     }
 
     return found;