Skip to content
This repository has been archived by the owner on Aug 4, 2022. It is now read-only.

Commit

Permalink
Bug 1130923 - Remove some DASHDecoder remnants: RestrictedAccessMonit…
Browse files Browse the repository at this point in the history
…or and GetByteRangeForSeek. r=cpearce
  • Loading branch information
kinetiknz committed Feb 9, 2015
1 parent fc2a9a3 commit 94bfd45
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 41 deletions.
2 changes: 1 addition & 1 deletion dom/media/MediaDecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1551,7 +1551,7 @@ bool MediaDecoder::OnDecodeThread() const {
}

ReentrantMonitor& MediaDecoder::GetReentrantMonitor() {
return mReentrantMonitor.GetReentrantMonitor();
return mReentrantMonitor;
}

ImageContainer* MediaDecoder::GetImageContainer()
Expand Down
43 changes: 3 additions & 40 deletions dom/media/MediaDecoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -346,14 +346,6 @@ class MediaDecoder : public nsIObserver,
// the seek target.
virtual nsresult Seek(double aTime, SeekTarget::Type aSeekType);

// Enables decoders to supply an enclosing byte range for a seek offset.
// E.g. used by ChannelMediaResource to download a whole cluster for
// DASH-WebM.
virtual nsresult GetByteRangeForSeek(int64_t const aOffset,
MediaByteRange &aByteRange) {
return NS_ERROR_NOT_AVAILABLE;
}

// Initialize state machine and schedule it.
nsresult InitializeStateMachine(MediaDecoder* aCloneDonor);

Expand Down Expand Up @@ -1082,40 +1074,11 @@ class MediaDecoder : public nsIObserver,
// Media data resource.
nsRefPtr<MediaResource> mResource;

private:
// |ReentrantMonitor| for detecting when the video play state changes. A call
// to |Wait| on this monitor will block the thread until the next state
// change.
// Using a wrapper class to restrict direct access to the |ReentrantMonitor|
// object. Subclasses may override |MediaDecoder|::|GetReentrantMonitor|
// e.g. |DASHRepDecoder|::|GetReentrantMonitor| returns the monitor in the
// main |DASHDecoder| object. In this case, directly accessing the
// member variable mReentrantMonitor in |DASHRepDecoder| is wrong.
// The wrapper |RestrictedAccessMonitor| restricts use to the getter
// function rather than the object itself.
private:
class RestrictedAccessMonitor
{
public:
explicit RestrictedAccessMonitor(const char* aName) :
mReentrantMonitor(aName)
{
MOZ_COUNT_CTOR(RestrictedAccessMonitor);
}
~RestrictedAccessMonitor()
{
MOZ_COUNT_DTOR(RestrictedAccessMonitor);
}

// Returns a ref to the reentrant monitor
ReentrantMonitor& GetReentrantMonitor() {
return mReentrantMonitor;
}
private:
ReentrantMonitor mReentrantMonitor;
};

// The |RestrictedAccessMonitor| member object.
RestrictedAccessMonitor mReentrantMonitor;
// change. Explicitly private for force access via GetReentrantMonitor.
ReentrantMonitor mReentrantMonitor;

#ifdef MOZ_EME
nsRefPtr<CDMProxy> mProxy;
Expand Down

0 comments on commit 94bfd45

Please sign in to comment.