Bug 1145101: Part4. Fix coding style. r=cpearce
authorJean-Yves Avenard <jyavenard@mozilla.com>
Mon, 23 Mar 2015 11:12:58 +1100
changeset 265313 746509b8d9a676818298de3d47d5d0e34b2c8386
parent 265312 6fbef6e970cdad6a5a941f6c42f19d70189ec563
child 265314 d91343508a39f944dd62116fba3e5a4b5bd74470
push id830
push userraliiev@mozilla.com
push dateFri, 19 Jun 2015 19:24:37 +0000
treeherdermozilla-release@932614382a68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs1145101
milestone39.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 1145101: Part4. Fix coding style. r=cpearce
dom/media/fmp4/SharedDecoderManager.cpp
dom/media/fmp4/SharedDecoderManager.h
--- a/dom/media/fmp4/SharedDecoderManager.cpp
+++ b/dom/media/fmp4/SharedDecoderManager.cpp
@@ -7,17 +7,20 @@
 #include "SharedDecoderManager.h"
 #include "mp4_demuxer/DecoderData.h"
 
 namespace mozilla {
 
 class SharedDecoderCallback : public MediaDataDecoderCallback
 {
 public:
-  explicit SharedDecoderCallback(SharedDecoderManager* aManager) : mManager(aManager) {}
+  explicit SharedDecoderCallback(SharedDecoderManager* aManager)
+    : mManager(aManager)
+  {
+  }
 
   virtual void Output(MediaData* aData) override
   {
     if (mManager->mActiveCallback) {
       mManager->mActiveCallback->Output(aData);
     }
   }
   virtual void Error() override
@@ -61,32 +64,39 @@ SharedDecoderManager::SharedDecoderManag
   , mWaitForInternalDrain(false)
   , mMonitor("SharedDecoderProxy")
   , mDecoderReleasedResources(false)
 {
   MOZ_ASSERT(NS_IsMainThread()); // taskqueue must be created on main thread.
   mCallback = new SharedDecoderCallback(this);
 }
 
-SharedDecoderManager::~SharedDecoderManager() {}
+SharedDecoderManager::~SharedDecoderManager()
+{
+}
 
 already_AddRefed<MediaDataDecoder>
 SharedDecoderManager::CreateVideoDecoder(
   PlatformDecoderModule* aPDM,
   const mp4_demuxer::VideoDecoderConfig& aConfig,
-  layers::LayersBackend aLayersBackend, layers::ImageContainer* aImageContainer,
-  FlushableMediaTaskQueue* aVideoTaskQueue, MediaDataDecoderCallback* aCallback)
+  layers::LayersBackend aLayersBackend,
+  layers::ImageContainer* aImageContainer,
+  FlushableMediaTaskQueue* aVideoTaskQueue,
+  MediaDataDecoderCallback* aCallback)
 {
   if (!mDecoder) {
     // We use the manager's task queue for the decoder, rather than the one
     // passed in, so that none of the objects sharing the decoder can shutdown
     // the task queue while we're potentially still using it for a *different*
     // object also sharing the decoder.
-    mDecoder = aPDM->CreateVideoDecoder(
-      aConfig, aLayersBackend, aImageContainer, mTaskQueue, mCallback);
+    mDecoder = aPDM->CreateVideoDecoder(aConfig,
+                                        aLayersBackend,
+                                        aImageContainer,
+                                        mTaskQueue,
+                                        mCallback);
     if (!mDecoder) {
       mPDM = nullptr;
       return nullptr;
     }
     mPDM = aPDM;
     nsresult rv = mDecoder->Init();
     NS_ENSURE_SUCCESS(rv, nullptr);
   }
@@ -98,17 +108,21 @@ SharedDecoderManager::CreateVideoDecoder
 bool
 SharedDecoderManager::Recreate(PlatformDecoderModule* aPDM,
                                const mp4_demuxer::VideoDecoderConfig& aConfig,
                                layers::LayersBackend aLayersBackend,
                                layers::ImageContainer* aImageContainer)
 {
   mDecoder->Flush();
   mDecoder->Shutdown();
-  mDecoder = aPDM->CreateVideoDecoder(aConfig, aLayersBackend, aImageContainer, mTaskQueue, mCallback);
+  mDecoder = aPDM->CreateVideoDecoder(aConfig,
+                                      aLayersBackend,
+                                      aImageContainer,
+                                      mTaskQueue,
+                                      mCallback);
   if (!mDecoder) {
     mPDM = nullptr;
     return false;
   }
   mPDM = aPDM;
   nsresult rv = mDecoder->Init();
   return rv == NS_OK;
 }
@@ -184,23 +198,27 @@ SharedDecoderManager::Shutdown()
 }
 
 bool
 SharedDecoderManager::IsPDMInUse(const mozilla::PlatformDecoderModule* aPDM) const
 {
   return aPDM == mPDM;
 }
 
-SharedDecoderProxy::SharedDecoderProxy(
-  SharedDecoderManager* aManager, MediaDataDecoderCallback* aCallback)
-  : mManager(aManager), mCallback(aCallback)
+SharedDecoderProxy::SharedDecoderProxy(SharedDecoderManager* aManager,
+                                       MediaDataDecoderCallback* aCallback)
+  : mManager(aManager)
+  , mCallback(aCallback)
 {
 }
 
-SharedDecoderProxy::~SharedDecoderProxy() { Shutdown(); }
+SharedDecoderProxy::~SharedDecoderProxy()
+{
+  Shutdown();
+}
 
 nsresult
 SharedDecoderProxy::Init()
 {
   return NS_OK;
 }
 
 nsresult
--- a/dom/media/fmp4/SharedDecoderManager.h
+++ b/dom/media/fmp4/SharedDecoderManager.h
@@ -23,17 +23,18 @@ public:
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(SharedDecoderManager)
 
   SharedDecoderManager();
 
   already_AddRefed<MediaDataDecoder> CreateVideoDecoder(
     PlatformDecoderModule* aPDM,
     const mp4_demuxer::VideoDecoderConfig& aConfig,
     layers::LayersBackend aLayersBackend,
-    layers::ImageContainer* aImageContainer, FlushableMediaTaskQueue* aVideoTaskQueue,
+    layers::ImageContainer* aImageContainer,
+    FlushableMediaTaskQueue* aVideoTaskQueue,
     MediaDataDecoderCallback* aCallback);
 
   void SetReader(MediaDecoderReader* aReader);
   void Select(SharedDecoderProxy* aProxy);
   void SetIdle(MediaDataDecoder* aProxy);
   void ReleaseMediaResources();
   void Shutdown();
   bool IsPDMInUse(const PlatformDecoderModule* aPDM) const;