Bug 1252343. Part 2 - remove null checks for mReader which is const and never null. r=bechen.
MozReview-Commit-ID: 3u0IB9x98G
--- 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