Skip to content

Commit

Permalink
Merge m-c to inbound, a=merge
Browse files Browse the repository at this point in the history
  • Loading branch information
KWierso committed Aug 8, 2016
2 parents c42a2ff + 01ab991 commit 42f2376
Show file tree
Hide file tree
Showing 62 changed files with 1,107 additions and 368 deletions.
14 changes: 11 additions & 3 deletions b2g/dev/config/tooltool-manifests/linux64/releng.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,22 @@
"unpack": true
},
{
"version": "rustc 1.8.0 (db2939409 2016-04-11)",
"size": 123218320,
"digest": "7afcd7b39c4d5277db6b28951602aff4c698102ba45d3d811b353ca7446074beceebf03a2a529e323af19d73db4acbe96ec2bdad44def2e218ed36f55e82cab2",
"version": "gecko rustc 1.10.0 (cfcb716cf 2016-07-03)",
"size": 102276708,
"digest": "8cc9ea8347fc7e6e6fdb15a8fd1faae977f1235a426b879b3f9128ec91d8f2b6268297ce80bf4eceb47738bd40bfeda13f143dc3fe85f1434b13adfbc095ab90",
"algorithm": "sha512",
"filename": "rustc.tar.xz",
"unpack": true
},
{
"version": "cargo 0.13.0-nightly (664125b 2016-07-19)",
"size": 3123796,
"digest": "4b9d2bcb8488b6649ba6c748e19d33bfceb25c7566e882fc7e00322392e424a5a9c5878c11c61d57cdaecf67bcc110842c6eff95e49736e8f3c83d9ce1677122",
"algorithm": "sha512",
"filename": "cargo.tar.xz",
"unpack": true
},
{
"size": 167175,
"digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
"algorithm": "sha512",
Expand Down
4 changes: 4 additions & 0 deletions dom/base/nsGkAtomList.h
Original file line number Diff line number Diff line change
Expand Up @@ -952,6 +952,10 @@ GK_ATOM(onwebkitAnimationEnd, "onwebkitAnimationEnd")
GK_ATOM(onwebkitAnimationIteration, "onwebkitAnimationIteration")
GK_ATOM(onwebkitAnimationStart, "onwebkitAnimationStart")
GK_ATOM(onwebkitTransitionEnd, "onwebkitTransitionEnd")
GK_ATOM(onwebkitanimationend, "onwebkitanimationend")
GK_ATOM(onwebkitanimationiteration, "onwebkitanimationiteration")
GK_ATOM(onwebkitanimationstart, "onwebkitanimationstart")
GK_ATOM(onwebkittransitionend, "onwebkittransitionend")
GK_ATOM(onwebsocket, "onwebsocket")
GK_ATOM(onwheel, "onwheel")
GK_ATOM(open, "open")
Expand Down
84 changes: 51 additions & 33 deletions dom/events/EventNameList.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
#define TOUCH_EVENT MESSAGE_TO_EVENT
#define DOCUMENT_ONLY_EVENT MESSAGE_TO_EVENT
#define NON_IDL_EVENT MESSAGE_TO_EVENT
#endif
#endif /* MESSAGE_TO_EVENT */

#ifdef DEFINED_FORWARDED_EVENT
#error "Don't define DEFINED_FORWARDED_EVENT"
Expand Down Expand Up @@ -956,40 +956,58 @@ NON_IDL_EVENT(MozEdgeUICompleted,
eSimpleGestureEventClass)

// CSS Transition & Animation events:
NON_IDL_EVENT(transitionend,
eTransitionEnd,
EventNameType_None,
eTransitionEventClass)
NON_IDL_EVENT(animationstart,
eAnimationStart,
EventNameType_None,
eAnimationEventClass)
NON_IDL_EVENT(animationend,
eAnimationEnd,
EventNameType_None,
eAnimationEventClass)
NON_IDL_EVENT(animationiteration,
eAnimationIteration,
EventNameType_None,
eAnimationEventClass)
EVENT(transitionend,
eTransitionEnd,
EventNameType_All,
eTransitionEventClass)
EVENT(animationstart,
eAnimationStart,
EventNameType_All,
eAnimationEventClass)
EVENT(animationend,
eAnimationEnd,
EventNameType_All,
eAnimationEventClass)
EVENT(animationiteration,
eAnimationIteration,
EventNameType_All,
eAnimationEventClass)

// Webkit-prefixed versions of Transition & Animation events, for web compat:
NON_IDL_EVENT(webkitTransitionEnd,
eWebkitTransitionEnd,
EventNameType_None,
eTransitionEventClass)
NON_IDL_EVENT(webkitAnimationEnd,
eWebkitAnimationEnd,
EventNameType_None,
eAnimationEventClass)
NON_IDL_EVENT(webkitAnimationIteration,
eWebkitAnimationIteration,
EventNameType_None,
eAnimationEventClass)
NON_IDL_EVENT(webkitAnimationStart,
eWebkitAnimationStart,
EventNameType_None,
eAnimationEventClass)
EVENT(webkitAnimationEnd,
eWebkitAnimationEnd,
EventNameType_All,
eAnimationEventClass)
EVENT(webkitAnimationIteration,
eWebkitAnimationIteration,
EventNameType_All,
eAnimationEventClass)
EVENT(webkitAnimationStart,
eWebkitAnimationStart,
EventNameType_All,
eAnimationEventClass)
EVENT(webkitTransitionEnd,
eWebkitTransitionEnd,
EventNameType_All,
eTransitionEventClass)
#ifndef MESSAGE_TO_EVENT
EVENT(webkitanimationend,
eWebkitAnimationEnd,
EventNameType_All,
eAnimationEventClass)
EVENT(webkitanimationiteration,
eWebkitAnimationIteration,
EventNameType_All,
eAnimationEventClass)
EVENT(webkitanimationstart,
eWebkitAnimationStart,
EventNameType_All,
eAnimationEventClass)
EVENT(webkittransitionend,
eWebkitTransitionEnd,
EventNameType_All,
eTransitionEventClass)
#endif

NON_IDL_EVENT(audioprocess,
eAudioProcess,
Expand Down
19 changes: 8 additions & 11 deletions dom/html/HTMLMediaElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -870,11 +870,7 @@ HTMLMediaElement::Ended()
return stream->IsFinished();
}

if (mDecoder) {
return mDecoder->IsEndedOrShutdown();
}

return false;
return mDecoder && mDecoder->IsEnded();
}

NS_IMETHODIMP HTMLMediaElement::GetEnded(bool* aEnded)
Expand Down Expand Up @@ -2670,7 +2666,7 @@ HTMLMediaElement::PlayInternal(bool aCallerIsChrome)
// Even if we just did Load() or ResumeLoad(), we could already have a decoder
// here if we managed to clone an existing decoder.
if (mDecoder) {
if (mDecoder->IsEndedOrShutdown()) {
if (mDecoder->IsEnded()) {
SetCurrentTime(0);
}
if (!mPausedForInactiveDocumentOrChannel) {
Expand Down Expand Up @@ -4083,7 +4079,7 @@ void HTMLMediaElement::PlaybackEnded()
// We changed state which can affect AddRemoveSelfReference
AddRemoveSelfReference();

NS_ASSERTION(!mDecoder || mDecoder->IsEndedOrShutdown(),
NS_ASSERTION(!mDecoder || mDecoder->IsEnded(),
"Decoder fired ended, but not in ended state");

// Discard all output streams that have finished now.
Expand Down Expand Up @@ -4350,7 +4346,8 @@ HTMLMediaElement::UpdateReadyStateInternal()
return;
}

if (mDownloadSuspendedByCache && mDecoder && !mDecoder->IsEndedOrShutdown() &&
if (mDownloadSuspendedByCache &&
mDecoder && !mDecoder->IsEnded() &&
mFirstFrameLoaded) {
// The decoder has signaled that the download has been suspended by the
// media cache. So move readyState into HAVE_ENOUGH_DATA, in case there's
Expand Down Expand Up @@ -4756,7 +4753,7 @@ bool HTMLMediaElement::IsPlaybackEnded() const
// the current playback position is equal to the effective end of the media resource.
// See bug 449157.
return mReadyState >= nsIDOMHTMLMediaElement::HAVE_METADATA &&
mDecoder ? mDecoder->IsEndedOrShutdown() : false;
mDecoder && mDecoder->IsEnded();
}

already_AddRefed<nsIPrincipal> HTMLMediaElement::GetCurrentPrincipal()
Expand Down Expand Up @@ -4870,7 +4867,7 @@ void HTMLMediaElement::SuspendOrResumeElement(bool aPauseElement, bool aSuspendE
#endif
if (mDecoder) {
mDecoder->Resume();
if (!mPaused && !mDecoder->IsEndedOrShutdown()) {
if (!mPaused && !mDecoder->IsEnded()) {
mDecoder->Play();
}
}
Expand Down Expand Up @@ -4956,7 +4953,7 @@ void HTMLMediaElement::AddRemoveSelfReference()
bool needSelfReference = !mShuttingDown &&
ownerDoc->IsActive() &&
(mDelayingLoadEvent ||
(!mPaused && mDecoder && !mDecoder->IsEndedOrShutdown()) ||
(!mPaused && mDecoder && !mDecoder->IsEnded()) ||
(!mPaused && mSrcStream && !mSrcStream->IsFinished()) ||
(mDecoder && mDecoder->IsSeeking()) ||
CanActivateAutoplay() ||
Expand Down
3 changes: 0 additions & 3 deletions dom/ipc/ContentParent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1006,10 +1006,7 @@ ContentParent::RecvUngrabPointer(const uint32_t& aTime)
NS_RUNTIMEABORT("This message only makes sense on GTK platforms");
return false;
#else
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
gdk_pointer_ungrab(aTime);
#pragma GCC diagnostic pop
return true;
#endif
}
Expand Down
45 changes: 15 additions & 30 deletions dom/media/MediaDecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ MediaDecoderOwner*
MediaDecoder::ResourceCallback::GetMediaOwner() const
{
MOZ_ASSERT(NS_IsMainThread());
return mDecoder ? mDecoder->GetOwner() : nullptr;
return mDecoder ? mDecoder->mOwner : nullptr;
}

void
Expand Down Expand Up @@ -571,7 +571,7 @@ MediaDecoder::MediaDecoder(MediaDecoderOwner* aOwner)
"MediaDecoder::mMediaSeekable (Canonical)")
, mMediaSeekableOnlyInBufferedRanges(AbstractThread::MainThread(), false,
"MediaDecoder::mMediaSeekableOnlyInBufferedRanges (Canonical)")
, mIsVisible(AbstractThread::MainThread(), !mOwner->IsHidden(),
, mIsVisible(AbstractThread::MainThread(), !aOwner->IsHidden(),
"MediaDecoder::mIsVisible (Canonical)")
, mTelemetryReported(false)
{
Expand Down Expand Up @@ -616,10 +616,7 @@ void
MediaDecoder::Shutdown()
{
MOZ_ASSERT(NS_IsMainThread());

if (IsShutdown()) {
return;
}
MOZ_ASSERT(!IsShutdown());

// Unwatch all watch targets to prevent further notifications.
mWatchManager.Shutdown();
Expand All @@ -640,7 +637,6 @@ MediaDecoder::Shutdown()
mMetadataLoadedListener.Disconnect();
mFirstFrameLoadedListener.Disconnect();
mOnPlaybackEvent.Disconnect();
mOnSeekingStart.Disconnect();
mOnMediaNotSeekable.Disconnect();

mDecoderStateMachine->BeginShutdown()
Expand All @@ -667,6 +663,7 @@ MediaDecoder::Shutdown()
CancelDormantTimer();

ChangeState(PLAY_STATE_SHUTDOWN);
mOwner = nullptr;
}

MediaDecoder::~MediaDecoder()
Expand All @@ -691,6 +688,9 @@ MediaDecoder::OnPlaybackEvent(MediaEventType aEvent)
case MediaEventType::PlaybackEnded:
PlaybackEnded();
break;
case MediaEventType::SeekStarted:
SeekingStarted();
break;
case MediaEventType::DecodeError:
DecodeError();
break;
Expand Down Expand Up @@ -773,8 +773,6 @@ MediaDecoder::SetStateMachineParameters()

mOnPlaybackEvent = mDecoderStateMachine->OnPlaybackEvent().Connect(
AbstractThread::MainThread(), this, &MediaDecoder::OnPlaybackEvent);
mOnSeekingStart = mDecoderStateMachine->OnSeekingStart().Connect(
AbstractThread::MainThread(), this, &MediaDecoder::SeekingStarted);
mOnMediaNotSeekable = mDecoderStateMachine->OnMediaNotSeekable().Connect(
AbstractThread::MainThread(), this, &MediaDecoder::OnMediaNotSeekable);
}
Expand Down Expand Up @@ -1074,13 +1072,6 @@ MediaDecoder::IsSeeking() const
return mLogicallySeeking;
}

bool
MediaDecoder::IsEndedOrShutdown() const
{
MOZ_ASSERT(NS_IsMainThread());
return IsEnded() || IsShutdown();
}

bool
MediaDecoder::OwnerHasError() const
{
Expand Down Expand Up @@ -1223,9 +1214,7 @@ void
MediaDecoder::NotifyBytesDownloaded()
{
MOZ_ASSERT(NS_IsMainThread());
if (IsShutdown()) {
return;
}
MOZ_ASSERT(!IsShutdown());
UpdatePlaybackRate();
mOwner->DownloadProgressed();
}
Expand Down Expand Up @@ -1324,13 +1313,11 @@ MediaDecoder::OnSeekRejected()
}

void
MediaDecoder::SeekingStarted(MediaDecoderEventVisibility aEventVisibility)
MediaDecoder::SeekingStarted()
{
MOZ_ASSERT(NS_IsMainThread());
MOZ_ASSERT(!IsShutdown());
if (aEventVisibility != MediaDecoderEventVisibility::Suppressed) {
mOwner->SeekStarted();
}
mOwner->SeekStarted();
}

void
Expand Down Expand Up @@ -1364,6 +1351,9 @@ MediaDecoder::UpdateLogicalPositionInternal(MediaDecoderEventVisibility aEventVi
MOZ_ASSERT(!IsShutdown());

double currentPosition = static_cast<double>(CurrentPosition()) / static_cast<double>(USECS_PER_S);
if (mPlayState == PLAY_STATE_ENDED) {
currentPosition = std::max(currentPosition, mDuration);
}
bool logicalPositionChanged = mLogicalPosition != currentPosition;
mLogicalPosition = currentPosition;

Expand Down Expand Up @@ -1659,12 +1649,7 @@ void MediaDecoder::AddSizeOfResources(ResourceSizes* aSizes) {
void
MediaDecoder::NotifyDataArrived() {
MOZ_ASSERT(NS_IsMainThread());

// Don't publish events since task queues might be shutting down.
if (IsShutdown()) {
return;
}

MOZ_ASSERT(!IsShutdown());
mDataArrivedEvent.Notify();
}

Expand Down Expand Up @@ -1857,7 +1842,7 @@ MediaDecoder::GetOwner() const
{
MOZ_ASSERT(NS_IsMainThread());
// mOwner is valid until shutdown.
return !IsShutdown() ? mOwner : nullptr;
return mOwner;
}

void
Expand Down
Loading

0 comments on commit 42f2376

Please sign in to comment.