Bug 1409178 - Remove MediaDecoder::InitStatics() since it's a no-op. r?jwwang draft
authorChris Pearce <cpearce@mozilla.com>
Mon, 16 Oct 2017 22:39:02 +0200
changeset 681027 4f2392001b76d171ea45e0f48bd1aedeb869d9ca
parent 680927 d157da528c16e87cf3e9b718c2ffc8acc22c0bd2
child 681028 12406089a325ea5818822b72b1d90382f07eb5a3
push id84732
push userbmo:cpearce@mozilla.com
push dateMon, 16 Oct 2017 21:22:22 +0000
reviewersjwwang
bugs1409178
milestone58.0a1
Bug 1409178 - Remove MediaDecoder::InitStatics() since it's a no-op. r?jwwang MozReview-Commit-ID: Leo5wNaxpjg
dom/media/MediaDecoder.cpp
dom/media/MediaDecoder.h
layout/build/nsLayoutStatics.cpp
--- a/dom/media/MediaDecoder.cpp
+++ b/dom/media/MediaDecoder.cpp
@@ -270,22 +270,16 @@ class MediaDecoder::BackgroundVideoDecod
 NS_IMPL_ISUPPORTS(MediaDecoder::BackgroundVideoDecodingPermissionObserver, nsIObserver)
 
 StaticRefPtr<MediaMemoryTracker> MediaMemoryTracker::sUniqueInstance;
 
 LazyLogModule gMediaTimerLog("MediaTimer");
 
 constexpr TimeUnit MediaDecoder::DEFAULT_NEXT_FRAME_AVAILABLE_BUFFERED;
 
-void
-MediaDecoder::InitStatics()
-{
-  MOZ_ASSERT(NS_IsMainThread());
-}
-
 NS_IMPL_ISUPPORTS(MediaMemoryTracker, nsIMemoryReporter)
 
 void
 MediaDecoder::NotifyOwnerActivityChanged(bool aIsDocumentVisible,
                                          Visibility aElementVisibility,
                                          bool aIsElementInTree)
 {
   MOZ_ASSERT(NS_IsMainThread());
--- a/dom/media/MediaDecoder.h
+++ b/dom/media/MediaDecoder.h
@@ -94,19 +94,16 @@ public:
     PLAY_STATE_START,
     PLAY_STATE_LOADING,
     PLAY_STATE_PAUSED,
     PLAY_STATE_PLAYING,
     PLAY_STATE_ENDED,
     PLAY_STATE_SHUTDOWN
   };
 
-  // Must be called exactly once, on the main thread, during startup.
-  static void InitStatics();
-
   explicit MediaDecoder(MediaDecoderInit& aInit);
 
   // Returns the container content type of the resource.
   // Safe to call from any thread.
   const MediaContainerType& ContainerType() const { return mContainerType; }
 
   // Cleanup internal data structures. Must be called on the main
   // thread by the owning object before that object disposes of this object.
--- a/layout/build/nsLayoutStatics.cpp
+++ b/layout/build/nsLayoutStatics.cpp
@@ -111,17 +111,16 @@
 #include "nsCookieService.h"
 #include "nsApplicationCacheService.h"
 #include "mozilla/dom/CustomElementRegistry.h"
 #include "mozilla/dom/time/DateCacheCleaner.h"
 #include "mozilla/EventDispatcher.h"
 #include "mozilla/IMEStateManager.h"
 #include "mozilla/dom/HTMLVideoElement.h"
 #include "TouchManager.h"
-#include "MediaDecoder.h"
 #include "MediaPrefs.h"
 #include "mozilla/ServoBindings.h"
 #include "mozilla/StaticPresData.h"
 #include "mozilla/StylePrefs.h"
 #include "mozilla/dom/WebIDLGlobalNameHash.h"
 #include "mozilla/dom/ipc/IPCBlobInputStreamStorage.h"
 #include "mozilla/dom/U2FTokenManager.h"
 #include "mozilla/dom/PointerEventHandler.h"
@@ -291,18 +290,16 @@ nsLayoutStatics::Initialize()
 
   ServiceWorkerRegistrar::Initialize();
 
 #ifdef DEBUG
   GeckoStyleContext::Initialize();
   mozilla::LayerAnimationInfo::Initialize();
 #endif
 
-  MediaDecoder::InitStatics();
-
   PromiseDebugging::Init();
 
   mozilla::dom::WebCryptoThreadPool::Initialize();
 
 #ifdef MOZ_STYLO
   if (XRE_IsParentProcess() || XRE_IsContentProcess()) {
     InitializeServo();
   }