Bug 1355933: P1. Replace nsAutoPtr with UniquePtr. r?kamidphish draft
authorJean-Yves Avenard <jyavenard@mozilla.com>
Wed, 12 Apr 2017 23:05:25 +0200
changeset 561789 f1381d4a3013c2c08aba7fc518ac981f707157c9
parent 561788 1c76e59cba1e4540c0060c112a1ed2d13344d95b
child 561790 921060a7f73f3142aacae0e6bf6bdb6ed9c90a6d
push id53869
push userbmo:jyavenard@mozilla.com
push dateThu, 13 Apr 2017 07:09:28 +0000
reviewerskamidphish
bugs1355933
milestone55.0a1
Bug 1355933: P1. Replace nsAutoPtr with UniquePtr. r?kamidphish MozReview-Commit-ID: 14Hj7fUDwpx
dom/media/ADTSDemuxer.cpp
--- a/dom/media/ADTSDemuxer.cpp
+++ b/dom/media/ADTSDemuxer.cpp
@@ -1,23 +1,21 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "ADTSDemuxer.h"
 
-#include <inttypes.h>
-
-#include "nsAutoPtr.h"
+#include "TimeUnits.h"
 #include "VideoUtils.h"
-#include "TimeUnits.h"
-#include "prenv.h"
 #include "mozilla/SizePrintfMacros.h"
+#include "mozilla/UniquePtr.h"
+#include <inttypes.h>
 
 extern mozilla::LazyLogModule gMediaDemuxerLog;
 #define ADTSLOG(msg, ...) \
   MOZ_LOG(gMediaDemuxerLog, LogLevel::Debug, ("ADTSDemuxer " msg, ##__VA_ARGS__))
 #define ADTSLOGV(msg, ...) \
   MOZ_LOG(gMediaDemuxerLog, LogLevel::Verbose, ("ADTSDemuxer " msg, ##__VA_ARGS__))
 
 namespace mozilla {
@@ -733,17 +731,17 @@ ADTSTrackDemuxer::GetNextFrame(const adt
     return nullptr;
 
   const int64_t offset = aFrame.PayloadOffset();
   const uint32_t length = aFrame.PayloadLength();
 
   RefPtr<MediaRawData> frame = new MediaRawData();
   frame->mOffset = offset;
 
-  nsAutoPtr<MediaRawDataWriter> frameWriter(frame->CreateWriter());
+  UniquePtr<MediaRawDataWriter> frameWriter(frame->CreateWriter());
   if (!frameWriter->SetSize(length)) {
     ADTSLOG("GetNext() Exit failed to allocated media buffer");
     return nullptr;
   }
 
   const uint32_t read = Read(frameWriter->Data(), offset, length);
   if (read != length) {
     ADTSLOG("GetNext() Exit read=%u frame->Size()=%" PRIuSIZE, read, frame->Size());