author | Ed Morley <emorley@mozilla.com> |
Mon, 29 Jul 2013 09:55:15 +0100 | |
changeset 140312 | 4382f83efcaf03d82dcab6dd122410daab3ccbda |
parent 140311 | fab0e9b04d8da8a58c71a0f7168650df1ae9d01c |
child 140313 | 47f46080685f1a6d6058198b4b11d00e2c82aa51 |
push id | 31689 |
push user | emorley@mozilla.com |
push date | Mon, 29 Jul 2013 08:56:24 +0000 |
treeherder | mozilla-inbound@47f46080685f [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
bugs | 856361 |
milestone | 25.0a1 |
backs out | 3f2c0edda4c265a9e34e791fa527d682b8de7be1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/content/html/content/src/HTMLMediaElement.cpp +++ b/content/html/content/src/HTMLMediaElement.cpp @@ -3246,26 +3246,19 @@ already_AddRefed<nsIPrincipal> HTMLMedia nsRefPtr<nsIPrincipal> principal = mSrcStream->GetPrincipal(); return principal.forget(); } return nullptr; } void HTMLMediaElement::NotifyDecoderPrincipalChanged() { - nsRefPtr<nsIPrincipal> principal = GetCurrentPrincipal(); - - if (mDecoder) { - bool subsumes; - mDecoder->UpdateSameOriginStatus( - NS_SUCCEEDED(NodePrincipal()->Subsumes(principal, &subsumes)) && subsumes); - } - for (uint32_t i = 0; i < mOutputStreams.Length(); ++i) { OutputMediaStream* ms = &mOutputStreams[i]; + nsRefPtr<nsIPrincipal> principal = GetCurrentPrincipal(); ms->mStream->CombineWithPrincipal(principal); } } void HTMLMediaElement::UpdateMediaSize(nsIntSize size) { mMediaSize = size; }
--- a/content/media/MediaDecoder.cpp +++ b/content/media/MediaDecoder.cpp @@ -363,17 +363,16 @@ MediaDecoder::MediaDecoder() : mCurrentTime(0.0), mInitialVolume(0.0), mInitialPlaybackRate(1.0), mInitialPreservesPitch(true), mRequestedSeekTime(-1.0), mDuration(-1), mTransportSeekable(true), mMediaSeekable(true), - mSameOriginMedia(false), mReentrantMonitor("media.decoder"), mIsDormant(false), mPlayState(PLAY_STATE_PAUSED), mNextState(PLAY_STATE_PAUSED), mCalledResourceLoaded(false), mIgnoreProgressData(false), mInfiniteStream(false), mTriggerPlaybackEndedWhenSourceStreamFinishes(false), @@ -838,28 +837,16 @@ void MediaDecoder::DecodeError() return; if (mOwner) mOwner->DecodeError(); Shutdown(); } -void MediaDecoder::UpdateSameOriginStatus(bool aSameOrigin) -{ - ReentrantMonitorAutoEnter mon(GetReentrantMonitor()); - mSameOriginMedia = aSameOrigin; -} - -bool MediaDecoder::IsSameOriginMedia() -{ - GetReentrantMonitor().AssertCurrentThreadIn(); - return mSameOriginMedia; -} - bool MediaDecoder::IsSeeking() const { MOZ_ASSERT(NS_IsMainThread()); return mPlayState == PLAY_STATE_SEEKING; } bool MediaDecoder::IsEnded() const {
--- a/content/media/MediaDecoder.h +++ b/content/media/MediaDecoder.h @@ -635,20 +635,16 @@ public: virtual void NotifyPlaybackStopped() { GetReentrantMonitor().AssertCurrentThreadIn(); mPlaybackStatistics.Stop(); } // The actual playback rate computation. The monitor must be held. virtual double ComputePlaybackRate(bool* aReliable); - // Return true when the media is same-origin with the element. The monitor - // must be held. - bool IsSameOriginMedia(); - // Returns true if we can play the entire media through without stopping // to buffer, given the current download and playback rates. bool CanPlayThrough(); // Make the decoder state machine update the playback position. Called by // the reader on the decoder thread (Assertions for this checked by // mDecoderStateMachine). This must be called with the decode monitor // held. @@ -735,19 +731,16 @@ public: // Called when a "MozAudioAvailable" event listener is added. This enables // the decoder to only dispatch "MozAudioAvailable" events when a // handler exists, reducing overhead. Called on the main thread. virtual void NotifyAudioAvailableListener(); // Notifies the element that decoding has failed. virtual void DecodeError(); - // Indicate whether the media is same-origin with the element. - void UpdateSameOriginStatus(bool aSameOrigin); - MediaDecoderOwner* GetOwner() MOZ_OVERRIDE; #ifdef MOZ_RAW static bool IsRawEnabled(); #endif #ifdef MOZ_OGG static bool IsOggEnabled(); @@ -960,20 +953,16 @@ public: // True if the resource is seekable at a transport level (server supports byte // range requests, local file, etc.). bool mTransportSeekable; // True if the media is seekable (i.e. supports random access). bool mMediaSeekable; - // True if the media is same-origin with the element. Data can only be - // passed to MediaStreams when this is true. - bool mSameOriginMedia; - /****** * The following member variables can be accessed from any thread. ******/ // The state machine object for handling the decoding. It is safe to // call methods of this object from other threads. Its internal data // is synchronised on a monitor. The lifetime of this object is // after mPlayState is LOADING and before mPlayState is SHUTDOWN. It
--- a/content/media/MediaDecoderStateMachine.cpp +++ b/content/media/MediaDecoderStateMachine.cpp @@ -614,20 +614,16 @@ void MediaDecoderStateMachine::SendStrea DecodedStreamData* stream = mDecoder->GetDecodedStream(); if (!stream) return; if (mState == DECODER_STATE_DECODING_METADATA) return; - if (!mDecoder->IsSameOriginMedia()) { - return; - } - // If there's still an audio thread alive, then we can't send any stream // data yet since both SendStreamData and the audio thread want to be in // charge of popping the audio queue. We're waiting for the audio thread // to die before sending anything to our stream. if (mAudioThread) return; int64_t minLastAudioPacketTime = INT64_MAX;