Bug 1252343. Part 2 - remove null checks for mReader which is const and never null. r=bechen. draft
authorJW Wang <jwwang@mozilla.com>
Tue, 01 Mar 2016 10:59:08 +0800
changeset 335649 2181294411fe5427d11ce22de32b9c85c87e03f6
parent 335648 5e1c270ef945157b9ef283db653ceea8d73c2e6d
child 515189 023f59ff229d35dd3a4a6855a87121f9ed199118
push id11845
push userjwwang@mozilla.com
push dateTue, 01 Mar 2016 02:59:29 +0000
reviewersbechen
bugs1252343
milestone47.0a1
Bug 1252343. Part 2 - remove null checks for mReader which is const and never null. r=bechen. MozReview-Commit-ID: 3u0IB9x98G
dom/media/MediaDecoderStateMachine.h
--- a/dom/media/MediaDecoderStateMachine.h
+++ b/dom/media/MediaDecoderStateMachine.h
@@ -210,19 +210,17 @@ public:
       }
     });
     OwnerThread()->Dispatch(r.forget());
   }
 
   // Drop reference to mReader and mResource. Only called during shutdown dance.
   void BreakCycles() {
     MOZ_ASSERT(NS_IsMainThread());
-    if (mReader) {
-      mReader->BreakCycles();
-    }
+    mReader->BreakCycles();
     mResource = nullptr;
   }
 
   TimedMetadataEventSource& TimedMetadataEvent() {
     return mMetadataManager.TimedMetadataEvent();
   }
 
   MediaEventSource<void>& OnMediaNotSeekable() {
@@ -243,27 +241,21 @@ public:
 
   MediaEventSource<MediaDecoderEventVisibility>&
   OnSeekingStart() { return mOnSeekingStart; }
 
   // Immutable after construction - may be called on any thread.
   bool IsRealTime() const { return mRealTime; }
 
   size_t SizeOfVideoQueue() {
-    if (mReader) {
-      return mReader->SizeOfVideoQueueInBytes();
-    }
-    return 0;
+    return mReader->SizeOfVideoQueueInBytes();
   }
 
   size_t SizeOfAudioQueue() {
-    if (mReader) {
-      return mReader->SizeOfAudioQueueInBytes();
-    }
-    return 0;
+    return mReader->SizeOfAudioQueueInBytes();
   }
 
 private:
   // Functions used by assertions to ensure we're calling things
   // on the appropriate threads.
   bool OnTaskQueue() const;
 
   // Initialization that needs to happen on the task queue. This is the first