From f3eac770a7f9e50dc6884fabe5302f4c8062efdc Mon Sep 17 00:00:00 2001 From: Bobby Holley Date: Mon, 29 Jun 2015 12:07:42 -0700 Subject: [PATCH] Bug 1178437 - Make mRealTime const and allow it to be accessed on any thread. r=jww --- dom/media/MediaDecoderStateMachine.cpp | 5 ----- dom/media/MediaDecoderStateMachine.h | 5 +++-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/dom/media/MediaDecoderStateMachine.cpp b/dom/media/MediaDecoderStateMachine.cpp index 9f90822f57da..62f830319b81 100644 --- a/dom/media/MediaDecoderStateMachine.cpp +++ b/dom/media/MediaDecoderStateMachine.cpp @@ -1389,11 +1389,6 @@ void MediaDecoderStateMachine::VolumeChanged() } } -bool MediaDecoderStateMachine::IsRealTime() const -{ - return mRealTime; -} - void MediaDecoderStateMachine::RecomputeDuration() { MOZ_ASSERT(OnTaskQueue()); diff --git a/dom/media/MediaDecoderStateMachine.h b/dom/media/MediaDecoderStateMachine.h index 040e75053623..df54dea68b5c 100644 --- a/dom/media/MediaDecoderStateMachine.h +++ b/dom/media/MediaDecoderStateMachine.h @@ -179,7 +179,8 @@ public: void FinishShutdown(); - bool IsRealTime() const; + // Immutable after construction - may be called on any thread. + bool IsRealTime() const { return mRealTime; } // Functions used by assertions to ensure we're calling things // on the appropriate threads. @@ -725,7 +726,7 @@ private: WatchManager mWatchManager; // True is we are decoding a realtime stream, like a camera stream. - bool mRealTime; + const bool mRealTime; // True if we've dispatched a task to run the state machine but the task has // yet to run.