mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-21 17:25:36 +00:00
Bug 1394313 - replace use of nsAutoPtr with UniquePtr in MediaDecoderOwner.h. r=cpearce
MozReview-Commit-ID: 49lyvMzg7oY --HG-- extra : rebase_source : b83cd03b0026c73d0293ef937a3c2544349f464d
This commit is contained in:
parent
c259a3a1b5
commit
f8f989dd93
@ -5314,15 +5314,16 @@ void HTMLMediaElement::ProcessMediaFragmentURI()
|
||||
}
|
||||
}
|
||||
|
||||
void HTMLMediaElement::MetadataLoaded(const MediaInfo* aInfo,
|
||||
nsAutoPtr<const MetadataTags> aTags)
|
||||
void
|
||||
HTMLMediaElement::MetadataLoaded(const MediaInfo* aInfo,
|
||||
UniquePtr<const MetadataTags> aTags)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
SetMediaInfo(*aInfo);
|
||||
|
||||
mIsEncrypted = aInfo->IsEncrypted() || mPendingEncryptedInitData.IsEncrypted();
|
||||
mTags = aTags.forget();
|
||||
mTags = Move(aTags);
|
||||
mLoadedDataFired = false;
|
||||
ChangeReadyState(nsIDOMHTMLMediaElement::HAVE_METADATA);
|
||||
|
||||
@ -5735,7 +5736,7 @@ HTMLMediaElement::UpdateReadyStateInternal()
|
||||
if (hasVideoTracks) {
|
||||
mediaInfo.EnableVideo();
|
||||
}
|
||||
MetadataLoaded(&mediaInfo, nsAutoPtr<const MetadataTags>(nullptr));
|
||||
MetadataLoaded(&mediaInfo, nullptr);
|
||||
}
|
||||
|
||||
if (mMediaSource) {
|
||||
|
@ -169,8 +169,9 @@ public:
|
||||
// Called by the video decoder object, on the main thread,
|
||||
// when it has read the metadata containing video dimensions,
|
||||
// etc.
|
||||
virtual void MetadataLoaded(const MediaInfo* aInfo,
|
||||
nsAutoPtr<const MetadataTags> aTags) final override;
|
||||
virtual void MetadataLoaded(
|
||||
const MediaInfo* aInfo,
|
||||
UniquePtr<const MetadataTags> aTags) final override;
|
||||
|
||||
// Called by the decoder object, on the main thread,
|
||||
// when it has read the first frame of the video or audio.
|
||||
@ -1452,7 +1453,7 @@ protected:
|
||||
// Current audio volume
|
||||
double mVolume;
|
||||
|
||||
nsAutoPtr<const MetadataTags> mTags;
|
||||
UniquePtr<const MetadataTags> mTags;
|
||||
|
||||
// URI of the resource we're attempting to load. This stores the value we
|
||||
// return in the currentSrc attribute. Use GetCurrentSrc() to access the
|
||||
|
@ -735,8 +735,7 @@ MediaDecoder::MetadataLoaded(UniquePtr<MediaInfo> aInfo,
|
||||
// our new size.
|
||||
if (aEventVisibility != MediaDecoderEventVisibility::Suppressed) {
|
||||
mFiredMetadataLoaded = true;
|
||||
GetOwner()->MetadataLoaded(
|
||||
mInfo, nsAutoPtr<const MetadataTags>(aTags.release()));
|
||||
GetOwner()->MetadataLoaded(mInfo, Move(aTags));
|
||||
}
|
||||
// Invalidate() will end up calling GetOwner()->UpdateMediaSize with the last
|
||||
// dimensions retrieved from the video frame container. The video frame
|
||||
|
@ -6,8 +6,8 @@
|
||||
#ifndef MediaDecoderOwner_h_
|
||||
#define MediaDecoderOwner_h_
|
||||
|
||||
#include "mozilla/UniquePtr.h"
|
||||
#include "MediaInfo.h"
|
||||
#include "nsAutoPtr.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
@ -59,7 +59,7 @@ public:
|
||||
// etc.
|
||||
// Must take ownership of MetadataTags aTags argument.
|
||||
virtual void MetadataLoaded(const MediaInfo* aInfo,
|
||||
nsAutoPtr<const MetadataTags> aTags) = 0;
|
||||
UniquePtr<const MetadataTags> aTags) = 0;
|
||||
|
||||
// Called by the decoder object, on the main thread,
|
||||
// when it has read the first frame of the video or audio.
|
||||
|
@ -7,7 +7,6 @@
|
||||
|
||||
#include "MediaDecoderOwner.h"
|
||||
#include "mozilla/AbstractThread.h"
|
||||
#include "nsAutoPtr.h"
|
||||
|
||||
namespace mozilla
|
||||
{
|
||||
@ -22,7 +21,7 @@ public:
|
||||
void FireTimeUpdate(bool aPeriodic) override {}
|
||||
bool GetPaused() override { return false; }
|
||||
void MetadataLoaded(const MediaInfo* aInfo,
|
||||
nsAutoPtr<const MetadataTags> aTags) override
|
||||
UniquePtr<const MetadataTags> aTags) override
|
||||
{
|
||||
}
|
||||
void NetworkError() override {}
|
||||
|
Loading…
Reference in New Issue
Block a user