Bug 1334971: P2. Fix coding style. r?gerald draft
authorJean-Yves Avenard <jyavenard@mozilla.com>
Mon, 06 Feb 2017 15:09:43 +0100
changeset 479331 ddc0fda6cc9921d7a5a2a96912587233a5ce56a0
parent 479330 f0839207ca950be9776b91ff5dcff9736c08c2fd
child 479411 7acead4b2311ef7a47d56f5aa5c0b49b9af4d53f
push id44222
push userbmo:jyavenard@mozilla.com
push dateMon, 06 Feb 2017 14:12:04 +0000
reviewersgerald
bugs1334971
milestone54.0a1
Bug 1334971: P2. Fix coding style. r?gerald MozReview-Commit-ID: 1xMcYn354NT
dom/media/platforms/PDMFactory.cpp
dom/media/platforms/PDMFactory.h
--- a/dom/media/platforms/PDMFactory.cpp
+++ b/dom/media/platforms/PDMFactory.cpp
@@ -49,17 +49,18 @@
 
 #include <functional>
 
 namespace mozilla {
 
 extern already_AddRefed<PlatformDecoderModule> CreateAgnosticDecoderModule();
 extern already_AddRefed<PlatformDecoderModule> CreateBlankDecoderModule();
 
-class PDMFactoryImpl final {
+class PDMFactoryImpl final
+{
 public:
   PDMFactoryImpl()
   {
 #ifdef XP_WIN
     WMFDecoderModule::Init();
 #endif
 #ifdef MOZ_APPLEMEDIA
     AppleDecoderModule::Init();
@@ -88,17 +89,18 @@ public:
   };
 
   struct CheckResult
   {
     explicit CheckResult(Reason aReason,
                          MediaResult aResult = MediaResult(NS_OK))
       : mReason(aReason),
         mMediaResult(mozilla::Move(aResult))
-    {}
+    {
+    }
     CheckResult(const CheckResult& aOther) = default;
     CheckResult(CheckResult&& aOther) = default;
     CheckResult& operator=(const CheckResult& aOther) = default;
     CheckResult& operator=(CheckResult&& aOther) = default;
 
     Reason mReason;
     MediaResult mMediaResult;
   };
@@ -109,35 +111,35 @@ public:
   {
     mCheckerList.AppendElement(mozilla::Forward<Func>(aChecker));
   }
 
   void
   AddMediaFormatChecker(const TrackInfo& aTrackConfig)
   {
     if (aTrackConfig.IsVideo()) {
-    auto mimeType = aTrackConfig.GetAsVideoInfo()->mMimeType;
-    RefPtr<MediaByteBuffer> extraData = aTrackConfig.GetAsVideoInfo()->mExtraData;
-    AddToCheckList(
-      [mimeType, extraData]() {
+      auto mimeType = aTrackConfig.GetAsVideoInfo()->mMimeType;
+      RefPtr<MediaByteBuffer> extraData =
+          aTrackConfig.GetAsVideoInfo()->mExtraData;
+      AddToCheckList([mimeType, extraData]() {
         if (MP4Decoder::IsH264(mimeType)) {
           mp4_demuxer::SPSData spsdata;
           // WMF H.264 Video Decoder and Apple ATDecoder
           // do not support YUV444 format.
           // For consistency, all decoders should be checked.
-          if (mp4_demuxer::H264::DecodeSPSFromExtraData(extraData, spsdata) &&
-              (spsdata.profile_idc == 244 /* Hi444PP */ ||
-               spsdata.chroma_format_idc == PDMFactory::kYUV444)) {
+          if (mp4_demuxer::H264::DecodeSPSFromExtraData(extraData, spsdata)
+              && (spsdata.profile_idc == 244 /* Hi444PP */
+                  || spsdata.chroma_format_idc == PDMFactory::kYUV444)) {
             return CheckResult(
-              SupportChecker::Reason::kVideoFormatNotSupported,
-              MediaResult(
-                NS_ERROR_DOM_MEDIA_FATAL_ERR,
-                RESULT_DETAIL("Decoder may not have the capability to handle"
-                              " the requested video format"
-                              " with YUV444 chroma subsampling.")));
+                SupportChecker::Reason::kVideoFormatNotSupported,
+                MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR,
+                            RESULT_DETAIL(
+                                "Decoder may not have the capability to handle"
+                                " the requested video format"
+                                " with YUV444 chroma subsampling.")));
           }
         }
         return CheckResult(SupportChecker::Reason::kSupported);
       });
     }
   }
 
   SupportChecker::CheckResult
@@ -251,43 +253,46 @@ PDMFactory::CreateDecoderWithPDM(Platfor
   MediaResult* result = aParams.mError;
 
   SupportChecker supportChecker;
   const TrackInfo& config = aParams.mConfig;
   supportChecker.AddMediaFormatChecker(config);
 
   auto checkResult = supportChecker.Check();
   if (checkResult.mReason != SupportChecker::Reason::kSupported) {
-    DecoderDoctorDiagnostics* diagnostics = aParams.mDiagnostics;
-    if (checkResult.mReason == SupportChecker::Reason::kVideoFormatNotSupported) {
+    DecoderDoctorDiagnostics *diagnostics = aParams.mDiagnostics;
+    if (checkResult.mReason
+        == SupportChecker::Reason::kVideoFormatNotSupported) {
       if (diagnostics) {
         diagnostics->SetVideoNotSupported();
       }
       if (result) {
         *result = checkResult.mMediaResult;
       }
-    } else if (checkResult.mReason == SupportChecker::Reason::kAudioFormatNotSupported) {
+    } else if (checkResult.mReason
+               == SupportChecker::Reason::kAudioFormatNotSupported) {
       if (diagnostics) {
         diagnostics->SetAudioNotSupported();
       }
       if (result) {
         *result = checkResult.mMediaResult;
       }
     }
     return nullptr;
   }
 
   if (config.IsAudio()) {
     m = aPDM->CreateAudioDecoder(aParams);
     return m.forget();
   }
 
   if (!config.IsVideo()) {
-    *result = MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR,
-                          RESULT_DETAIL("Decoder configuration error, expected audio or video."));
+    *result = MediaResult(
+        NS_ERROR_DOM_MEDIA_FATAL_ERR,
+        RESULT_DETAIL("Decoder configuration error, expected audio or video."));
     return nullptr;
   }
 
   if (MP4Decoder::IsH264(config.mMimeType) && !aParams.mUseBlankDecoder) {
     RefPtr<H264Converter> h = new H264Converter(aPDM, aParams);
     const nsresult rv = h->GetLastError();
     if (NS_SUCCEEDED(rv) || rv == NS_ERROR_NOT_INITIALIZED) {
       // The H264Converter either successfully created the wrapped decoder,
--- a/dom/media/platforms/PDMFactory.h
+++ b/dom/media/platforms/PDMFactory.h
@@ -13,17 +13,18 @@
 class CDMProxy;
 
 namespace mozilla {
 
 class DecoderDoctorDiagnostics;
 class PDMFactoryImpl;
 template<class T> class StaticAutoPtr;
 
-class PDMFactory final {
+class PDMFactory final
+{
 public:
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(PDMFactory)
 
   PDMFactory();
 
   // Factory method that creates the appropriate PlatformDecoderModule for
   // the platform we're running on. Caller is responsible for deleting this
   // instance. It's expected that there will be multiple