Skip to content

Commit

Permalink
Bug 1144519 - Rename MediaDecoder::OnDecodeThread to MediaDecoder::On…
Browse files Browse the repository at this point in the history
…DecodeTaskQueue. r=jya
  • Loading branch information
bholley committed Mar 27, 2015
1 parent 4a2ba9d commit 3fa9691
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion dom/media/AbstractMediaDecoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class AbstractMediaDecoder : public nsISupports

virtual bool OnStateMachineTaskQueue() const = 0;

virtual bool OnDecodeThread() const = 0;
virtual bool OnDecodeTaskQueue() const = 0;

// Get the current MediaResource being used. Its URI will be returned
// by currentSrc. Returns what was passed to Load(), if Load() has been called.
Expand Down
10 changes: 5 additions & 5 deletions dom/media/MediaDecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,7 @@ void MediaDecoder::QueueMetadata(int64_t aPublishTime,
nsAutoPtr<MediaInfo> aInfo,
nsAutoPtr<MetadataTags> aTags)
{
NS_ASSERTION(OnDecodeThread(), "Should be on decode thread.");
MOZ_ASSERT(OnDecodeTaskQueue());
GetReentrantMonitor().AssertCurrentThreadIn();
mDecoderStateMachine->QueueMetadata(aPublishTime, aInfo, aTags);
}
Expand Down Expand Up @@ -1093,7 +1093,7 @@ MediaDecoder::GetStatistics()
double MediaDecoder::ComputePlaybackRate(bool* aReliable)
{
GetReentrantMonitor().AssertCurrentThreadIn();
MOZ_ASSERT(NS_IsMainThread() || OnStateMachineTaskQueue() || OnDecodeThread());
MOZ_ASSERT(NS_IsMainThread() || OnStateMachineTaskQueue() || OnDecodeTaskQueue());

int64_t length = mResource ? mResource->GetLength() : -1;
if (mDuration >= 0 && length >= 0) {
Expand Down Expand Up @@ -1506,7 +1506,7 @@ void MediaDecoder::Resume(bool aForceBuffering)

void MediaDecoder::StopProgressUpdates()
{
MOZ_ASSERT(OnStateMachineTaskQueue() || OnDecodeThread());
MOZ_ASSERT(OnStateMachineTaskQueue() || OnDecodeTaskQueue());
GetReentrantMonitor().AssertCurrentThreadIn();
mIgnoreProgressData = true;
if (mResource) {
Expand All @@ -1516,7 +1516,7 @@ void MediaDecoder::StopProgressUpdates()

void MediaDecoder::StartProgressUpdates()
{
MOZ_ASSERT(OnStateMachineTaskQueue() || OnDecodeThread());
MOZ_ASSERT(OnStateMachineTaskQueue() || OnDecodeTaskQueue());
GetReentrantMonitor().AssertCurrentThreadIn();
mIgnoreProgressData = false;
if (mResource) {
Expand Down Expand Up @@ -1576,7 +1576,7 @@ void MediaDecoder::SetPreservesPitch(bool aPreservesPitch)
}
}

bool MediaDecoder::OnDecodeThread() const {
bool MediaDecoder::OnDecodeTaskQueue() const {
NS_WARN_IF_FALSE(mDecoderStateMachine, "mDecoderStateMachine is null");
return mDecoderStateMachine ? mDecoderStateMachine->OnDecodeTaskQueue() : false;
}
Expand Down
2 changes: 1 addition & 1 deletion dom/media/MediaDecoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ class MediaDecoder : public nsIObserver,

bool OnStateMachineTaskQueue() const override;

bool OnDecodeThread() const override;
bool OnDecodeTaskQueue() const override;

// Returns the monitor for other threads to synchronise access to
// state.
Expand Down
4 changes: 2 additions & 2 deletions dom/media/mediasource/SourceBufferDecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,13 @@ SourceBufferDecoder::OnStateMachineTaskQueue() const
}

bool
SourceBufferDecoder::OnDecodeThread() const
SourceBufferDecoder::OnDecodeTaskQueue() const
{
// During initialization we run on our TrackBuffer's task queue.
if (mTaskQueue) {
return mTaskQueue->IsCurrentThreadIn();
}
return mParentDecoder->OnDecodeThread();
return mParentDecoder->OnDecodeTaskQueue();
}

SourceBufferResource*
Expand Down
4 changes: 2 additions & 2 deletions dom/media/mediasource/SourceBufferDecoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class SourceBufferDecoder final : public AbstractMediaDecoder
virtual bool IsMediaSeekable() final override;
virtual bool IsShutdown() const final override;
virtual bool IsTransportSeekable() final override;
virtual bool OnDecodeThread() const final override;
virtual bool OnDecodeTaskQueue() const final override;
virtual bool OnStateMachineTaskQueue() const final override;
virtual int64_t GetMediaDuration() final override;
virtual layers::ImageContainer* GetImageContainer() final override;
Expand Down Expand Up @@ -114,7 +114,7 @@ class SourceBufferDecoder final : public AbstractMediaDecoder

virtual CDMProxy* GetCDMProxy() override
{
MOZ_ASSERT(OnDecodeThread() || NS_IsMainThread());
MOZ_ASSERT(OnDecodeTaskQueue() || NS_IsMainThread());
ReentrantMonitorAutoEnter mon(GetReentrantMonitor());
return mCDMProxy;
}
Expand Down
2 changes: 1 addition & 1 deletion dom/media/mediasource/TrackBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,7 @@ TrackBuffer::AbortAppendData()
const nsTArray<nsRefPtr<SourceBufferDecoder>>&
TrackBuffer::Decoders()
{
// XXX assert OnDecodeThread
// XXX assert OnDecodeTaskQueue
return mInitializedDecoders;
}

Expand Down
2 changes: 1 addition & 1 deletion dom/media/webaudio/BufferDecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ BufferDecoder::OnStateMachineTaskQueue() const
}

bool
BufferDecoder::OnDecodeThread() const
BufferDecoder::OnDecodeTaskQueue() const
{
MOZ_ASSERT(mTaskQueueIdentity, "Forgot to call BeginDecoding?");
return mTaskQueueIdentity->IsCurrentThreadIn();
Expand Down
2 changes: 1 addition & 1 deletion dom/media/webaudio/BufferDecoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class BufferDecoder : public AbstractMediaDecoder

virtual bool OnStateMachineTaskQueue() const final override;

virtual bool OnDecodeThread() const final override;
virtual bool OnDecodeTaskQueue() const final override;

virtual MediaResource* GetResource() const final override;

Expand Down
2 changes: 1 addition & 1 deletion dom/media/webm/WebMReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ nsresult WebMReader::ReadMetadata(MediaInfo* aInfo,
// We can't use OnTaskQueue() here because of the wacky initialization task
// queue that TrackBuffer uses. We should be able to fix this when we do
// bug 1148234.
MOZ_ASSERT(mDecoder->OnDecodeThread());
MOZ_ASSERT(mDecoder->OnDecodeTaskQueue());

nestegg_io io;
io.read = webm_read;
Expand Down

0 comments on commit 3fa9691

Please sign in to comment.