Bug 1381758 - Remove the debug code added in bug 1326294. r=gerald

Bug 1326294 is fixed and we don't need the debug code anymore.
This help reduce the coupling with HTMLMediaElement and make MediaDecoder
easier to be reused by Servo.

MozReview-Commit-ID: KCwAjoQFPkS

--HG--
extra : rebase_source : 0c98899f63edb5971ddecb812635c9a6f693d448
This commit is contained in:
JW Wang 2017-07-18 16:36:01 +08:00
parent 80f58a3d1e
commit cda80ee431
2 changed files with 1 additions and 13 deletions

View File

@ -22,11 +22,11 @@
#include "mozilla/Telemetry.h" #include "mozilla/Telemetry.h"
#include "mozilla/dom/AudioTrack.h" #include "mozilla/dom/AudioTrack.h"
#include "mozilla/dom/AudioTrackList.h" #include "mozilla/dom/AudioTrackList.h"
#include "mozilla/dom/HTMLMediaElement.h"
#include "mozilla/dom/VideoTrack.h" #include "mozilla/dom/VideoTrack.h"
#include "mozilla/dom/VideoTrackList.h" #include "mozilla/dom/VideoTrackList.h"
#include "mozilla/layers/ShadowLayers.h" #include "mozilla/layers/ShadowLayers.h"
#include "nsComponentManagerUtils.h" #include "nsComponentManagerUtils.h"
#include "nsContentUtils.h"
#include "nsError.h" #include "nsError.h"
#include "nsIMemoryReporter.h" #include "nsIMemoryReporter.h"
#include "nsIObserver.h" #include "nsIObserver.h"
@ -258,8 +258,6 @@ MediaDecoder::MediaDecoder(MediaDecoderInit& aInit)
, INIT_CANONICAL(mPlaybackRateReliable, true) , INIT_CANONICAL(mPlaybackRateReliable, true)
, INIT_CANONICAL(mDecoderPosition, 0) , INIT_CANONICAL(mDecoderPosition, 0)
, mTelemetryReported(false) , mTelemetryReported(false)
, mIsMediaElement(!!mOwner->GetMediaElement())
, mElement(mOwner->GetMediaElement())
, mContainerType(aInit.mContainerType) , mContainerType(aInit.mContainerType)
{ {
MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(NS_IsMainThread());
@ -1558,8 +1556,6 @@ MediaDecoderOwner*
MediaDecoder::GetOwner() const MediaDecoder::GetOwner() const
{ {
MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(NS_IsMainThread());
// Check object lifetime when mOwner points to a media element.
MOZ_DIAGNOSTIC_ASSERT(!mOwner || !mIsMediaElement || mElement);
// mOwner is valid until shutdown. // mOwner is valid until shutdown.
return mOwner; return mOwner;
} }

View File

@ -35,10 +35,6 @@ class nsIPrincipal;
namespace mozilla { namespace mozilla {
namespace dom {
class HTMLMediaElement;
}
class AbstractThread; class AbstractThread;
class VideoFrameContainer; class VideoFrameContainer;
class MediaDecoderReader; class MediaDecoderReader;
@ -823,10 +819,6 @@ private:
void NotifyAudibleStateChanged(); void NotifyAudibleStateChanged();
bool mTelemetryReported; bool mTelemetryReported;
// Used to debug how mOwner becomes a dangling pointer in bug 1326294.
bool mIsMediaElement;
WeakPtr<dom::HTMLMediaElement> mElement;
const MediaContainerType mContainerType; const MediaContainerType mContainerType;
}; };