Bug 1626447 - Remove nsAutoPtr usage from dom/encoding. r=hsivonen

Differential Revision: https://phabricator.services.mozilla.com/D69118

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Eric Rahm 2020-04-03 21:05:19 +00:00
parent 3d161d547c
commit f3a22ac2e4

View File

@ -10,8 +10,8 @@
#include "mozilla/dom/NonRefcountedDOMObject.h"
#include "mozilla/dom/TextDecoderBinding.h"
#include "mozilla/dom/TypedArray.h"
#include "nsAutoPtr.h"
#include "mozilla/Encoding.h"
#include "mozilla/UniquePtr.h"
namespace mozilla {
@ -28,12 +28,12 @@ class TextDecoder final : public NonRefcountedDOMObject {
const nsAString& aEncoding,
const TextDecoderOptions& aOptions,
ErrorResult& aRv) {
nsAutoPtr<TextDecoder> txtDecoder(new TextDecoder());
auto txtDecoder = MakeUnique<TextDecoder>();
txtDecoder->Init(aEncoding, aOptions, aRv);
if (aRv.Failed()) {
return nullptr;
}
return txtDecoder.forget();
return txtDecoder.release();
}
TextDecoder() : mFatal(false), mIgnoreBOM(false) {