Bug 1355933: P1. Replace nsAutoPtr with UniquePtr. r?kamidphish
MozReview-Commit-ID: 14Hj7fUDwpx
--- 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());