Bug 881512 - Remove useless static_casts. r=cajbir
authorMatthew Gregan <kinetik@flim.org>
Tue, 22 Apr 2014 23:58:00 +1200
changeset 192427 5fbc68a34f624ff119a54d6ce981c0f02c3ba977
parent 192426 199c040d09f0ff14b4a10129e99effe0ec59166f
child 192428 1eddd13262dec62f3818a578cddce122f95ccd93
push idunknown
push userunknown
push dateunknown
reviewerscajbir
bugs881512
milestone31.0a1
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());