Bug 881512 - Remove useless static_casts. r=cajbir
authorMatthew Gregan <kinetik@flim.org>
Tue, 22 Apr 2014 23:58:00 +1200
changeset 198893 5fbc68a34f624ff119a54d6ce981c0f02c3ba977
parent 198892 199c040d09f0ff14b4a10129e99effe0ec59166f
child 198894 1eddd13262dec62f3818a578cddce122f95ccd93
push id3624
push userasasaki@mozilla.com
push dateMon, 09 Jun 2014 21:49:01 +0000
treeherdermozilla-beta@b1a5da15899a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscajbir
bugs881512
milestone31.0a1
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
Bug 881512 - Remove useless static_casts. r=cajbir
content/media/MediaDecoder.cpp
content/media/MediaDecoderStateMachine.cpp
--- a/content/media/MediaDecoder.cpp
+++ b/content/media/MediaDecoder.cpp
@@ -576,19 +576,17 @@ nsresult MediaDecoder::ScheduleStateMach
   MOZ_ASSERT(NS_IsMainThread());
   NS_ASSERTION(mDecoderStateMachine,
                "Must have state machine to start state machine thread");
   NS_ENSURE_STATE(mDecoderStateMachine);
 
   if (mShuttingDown)
     return NS_OK;
   ReentrantMonitorAutoEnter mon(GetReentrantMonitor());
-  MediaDecoderStateMachine* m =
-    static_cast<MediaDecoderStateMachine*>(mDecoderStateMachine.get());
-  return m->ScheduleStateMachine();
+  return mDecoderStateMachine->ScheduleStateMachine();
 }
 
 nsresult MediaDecoder::Play()
 {
   MOZ_ASSERT(NS_IsMainThread());
   ReentrantMonitorAutoEnter mon(GetReentrantMonitor());
   NS_ASSERTION(mDecoderStateMachine != nullptr, "Should have state machine.");
   nsresult res = ScheduleStateMachineThread();
--- a/content/media/MediaDecoderStateMachine.cpp
+++ b/content/media/MediaDecoderStateMachine.cpp
@@ -1029,17 +1029,17 @@ nsresult MediaDecoderStateMachine::Init(
     SharedThreadPool::Get(NS_LITERAL_CSTRING("Media State Machine"), 1));
   NS_ENSURE_TRUE(stateMachinePool, NS_ERROR_FAILURE);
 
   mDecodeTaskQueue = new MediaTaskQueue(decodePool.forget());
   NS_ENSURE_TRUE(mDecodeTaskQueue, NS_ERROR_FAILURE);
 
   MediaDecoderReader* cloneReader = nullptr;
   if (aCloneDonor) {
-    cloneReader = static_cast<MediaDecoderStateMachine*>(aCloneDonor)->mReader;
+    cloneReader = aCloneDonor->mReader;
   }
 
   mStateMachineThreadPool = stateMachinePool;
 
   nsresult rv;
   mTimer = do_CreateInstance("@mozilla.org/timer;1", &rv);
   NS_ENSURE_SUCCESS(rv, rv);
   rv = mTimer->SetTarget(GetStateMachineThread());