Bug 1271483 - p2. Fixed whitespace style - r=cpearce draft
authorGerald Squelart <gsquelart@mozilla.com>
Mon, 16 May 2016 21:35:14 +1000
changeset 380465 16db19c21ae8e594196959afb5a7178b1dd3ca16
parent 380464 a6d94f2f24b6ea351a0ed68dfcc0b5542e4c7bfa
child 380466 91962b143ae4813c017fb11b14a9d9fd374f6ce6
push id21229
push usergsquelart@mozilla.com
push dateWed, 22 Jun 2016 01:27:56 +0000
reviewerscpearce
bugs1271483
milestone50.0a1
Bug 1271483 - p2. Fixed whitespace style - r=cpearce MozReview-Commit-ID: IypVNdXjoSr
dom/media/DecoderDoctorDiagnostics.cpp
--- a/dom/media/DecoderDoctorDiagnostics.cpp
+++ b/dom/media/DecoderDoctorDiagnostics.cpp
@@ -19,18 +19,17 @@
 #include "nsPluginHost.h"
 
 static mozilla::LazyLogModule sDecoderDoctorLog("DecoderDoctor");
 #define DD_LOG(level, arg, ...) MOZ_LOG(sDecoderDoctorLog, level, (arg, ##__VA_ARGS__))
 #define DD_DEBUG(arg, ...) DD_LOG(mozilla::LogLevel::Debug, arg, ##__VA_ARGS__)
 #define DD_INFO(arg, ...) DD_LOG(mozilla::LogLevel::Info, arg, ##__VA_ARGS__)
 #define DD_WARN(arg, ...) DD_LOG(mozilla::LogLevel::Warning, arg, ##__VA_ARGS__)
 
-namespace mozilla
-{
+namespace mozilla {
 
 // Class that collects a sequence of diagnostics from the same document over a
 // small period of time, in order to provide a synthesized analysis.
 //
 // Referenced by the document through a nsINode property, mTimer, and
 // inter-task captures.
 // When notified that the document is dead, or when the timer expires but
 // nothing new happened, StopWatching() will remove the document property and
@@ -371,74 +370,74 @@ DecoderDoctorDocumentWatcher::Synthesize
   nsAutoString unplayableFormats;
   nsAutoString supportedKeySystems;
   nsAutoString unsupportedKeySystems;
   DecoderDoctorDiagnostics::KeySystemIssue lastKeySystemIssue =
     DecoderDoctorDiagnostics::eUnset;
 
   for (auto& diag : mDiagnosticsSequence) {
     switch (diag.mDecoderDoctorDiagnostics.Type()) {
-    case DecoderDoctorDiagnostics::eFormatSupportCheck:
-      if (diag.mDecoderDoctorDiagnostics.CanPlay()) {
-        canPlay = true;
-        AppendToStringList(playableFormats,
-                           diag.mDecoderDoctorDiagnostics.Format());
-      } else {
+      case DecoderDoctorDiagnostics::eFormatSupportCheck:
+        if (diag.mDecoderDoctorDiagnostics.CanPlay()) {
+          canPlay = true;
+          AppendToStringList(playableFormats,
+                             diag.mDecoderDoctorDiagnostics.Format());
+        } else {
 #if defined(XP_WIN)
-        if (diag.mDecoderDoctorDiagnostics.DidWMFFailToLoad()) {
-          WMFNeeded = true;
-        }
+          if (diag.mDecoderDoctorDiagnostics.DidWMFFailToLoad()) {
+            WMFNeeded = true;
+          }
 #endif
 #if defined(MOZ_FFMPEG)
-        if (diag.mDecoderDoctorDiagnostics.DidFFmpegFailToLoad()) {
-          FFMpegNeeded = true;
-        }
+          if (diag.mDecoderDoctorDiagnostics.DidFFmpegFailToLoad()) {
+            FFMpegNeeded = true;
+          }
 #endif
-        AppendToStringList(unplayableFormats,
-                           diag.mDecoderDoctorDiagnostics.Format());
-      }
-      break;
-    case DecoderDoctorDiagnostics::eMediaKeySystemAccessRequest:
-      if (diag.mDecoderDoctorDiagnostics.IsKeySystemSupported()) {
-        AppendToStringList(supportedKeySystems,
-                           diag.mDecoderDoctorDiagnostics.KeySystem());
-      } else {
-        AppendToStringList(unsupportedKeySystems,
-                           diag.mDecoderDoctorDiagnostics.KeySystem());
-        DecoderDoctorDiagnostics::KeySystemIssue issue =
-          diag.mDecoderDoctorDiagnostics.GetKeySystemIssue();
-        if (issue != DecoderDoctorDiagnostics::eUnset) {
-          lastKeySystemIssue = issue;
+          AppendToStringList(unplayableFormats,
+                             diag.mDecoderDoctorDiagnostics.Format());
         }
-      }
-      break;
-    default:
-      MOZ_ASSERT(diag.mDecoderDoctorDiagnostics.Type()
-                   == DecoderDoctorDiagnostics::eFormatSupportCheck
-                 || diag.mDecoderDoctorDiagnostics.Type()
-                      == DecoderDoctorDiagnostics::eMediaKeySystemAccessRequest);
-      break;
+        break;
+      case DecoderDoctorDiagnostics::eMediaKeySystemAccessRequest:
+        if (diag.mDecoderDoctorDiagnostics.IsKeySystemSupported()) {
+          AppendToStringList(supportedKeySystems,
+                             diag.mDecoderDoctorDiagnostics.KeySystem());
+        } else {
+          AppendToStringList(unsupportedKeySystems,
+                             diag.mDecoderDoctorDiagnostics.KeySystem());
+          DecoderDoctorDiagnostics::KeySystemIssue issue =
+            diag.mDecoderDoctorDiagnostics.GetKeySystemIssue();
+          if (issue != DecoderDoctorDiagnostics::eUnset) {
+            lastKeySystemIssue = issue;
+          }
+        }
+        break;
+      default:
+        MOZ_ASSERT(diag.mDecoderDoctorDiagnostics.Type()
+                     == DecoderDoctorDiagnostics::eFormatSupportCheck
+                   || diag.mDecoderDoctorDiagnostics.Type()
+                        == DecoderDoctorDiagnostics::eMediaKeySystemAccessRequest);
+        break;
     }
   }
 
   // Look at Key System issues first, as they may influence format checks.
   if (!unsupportedKeySystems.IsEmpty() && supportedKeySystems.IsEmpty()) {
     // No supported key systems!
     switch (lastKeySystemIssue) {
-    case DecoderDoctorDiagnostics::eWidevineWithNoWMF:
-      if (CheckSilverlight() != eSilverlightEnabled) {
-        DD_DEBUG("DecoderDoctorDocumentWatcher[%p, doc=%p]::SynthesizeAnalysis() - unsupported key systems: %s, widevine without WMF nor Silverlight",
-                 this, mDocument, NS_ConvertUTF16toUTF8(unplayableFormats).get());
-        ReportAnalysis(dom::DecoderDoctorNotificationType::Platform_decoder_not_found,
-                       "MediaWidevineNoWMFNoSilverlight", NS_LITERAL_STRING(""));
-        return;
-      }
-      break;
-    default:
-      break;
+      case DecoderDoctorDiagnostics::eWidevineWithNoWMF:
+        if (CheckSilverlight() != eSilverlightEnabled) {
+          DD_DEBUG("DecoderDoctorDocumentWatcher[%p, doc=%p]::SynthesizeAnalysis() - unsupported key systems: %s, widevine without WMF nor Silverlight",
+                   this, mDocument, NS_ConvertUTF16toUTF8(unplayableFormats).get());
+          ReportAnalysis(dom::DecoderDoctorNotificationType::Platform_decoder_not_found,
+                         "MediaWidevineNoWMFNoSilverlight", NS_LITERAL_STRING(""));
+          return;
+        }
+        break;
+      default:
+        break;
     }
   }
 
   if (!canPlay && !unplayableFormats.IsEmpty()) {
 #if defined(XP_WIN)
     if (WMFNeeded) {
       DD_DEBUG("DecoderDoctorDocumentWatcher[%p, doc=%p]::SynthesizeAnalysis() - formats: %s -> Cannot play media because WMF was not found",
                this, mDocument, NS_ConvertUTF16toUTF8(unplayableFormats).get());
@@ -614,49 +613,49 @@ DecoderDoctorDiagnostics::StoreMediaKeyS
 
 nsCString
 DecoderDoctorDiagnostics::GetDescription() const
 {
   MOZ_ASSERT(mDiagnosticsType == eFormatSupportCheck
              || mDiagnosticsType == eMediaKeySystemAccessRequest);
   nsCString s;
   switch (mDiagnosticsType) {
-  case eUnsaved:
-    s = "Unsaved diagnostics, cannot get accurate description";
-    break;
-  case eFormatSupportCheck:
-    s = "format='";
-    s += NS_ConvertUTF16toUTF8(mFormat).get();
-    s += mCanPlay ? "', can play" : "', cannot play";
-    if (mWMFFailedToLoad) {
-      s += ", Windows platform decoder failed to load";
-    }
-    if (mFFmpegFailedToLoad) {
-      s += ", Linux platform decoder failed to load";
-    }
-    if (mGMPPDMFailedToStartup) {
-      s += ", GMP PDM failed to startup";
-    } else if (!mGMP.IsEmpty()) {
-      s += ", Using GMP '";
-      s += mGMP;
-      s += "'";
-    }
-    break;
-  case eMediaKeySystemAccessRequest:
-    s = "key system='";
-    s += NS_ConvertUTF16toUTF8(mKeySystem).get();
-    s += mIsKeySystemSupported ? "', supported" : "', not supported";
-    switch (mKeySystemIssue) {
-    case eUnset:
+    case eUnsaved:
+      s = "Unsaved diagnostics, cannot get accurate description";
       break;
-    case eWidevineWithNoWMF:
-      s += ", Widevine with no WMF";
+    case eFormatSupportCheck:
+      s = "format='";
+      s += NS_ConvertUTF16toUTF8(mFormat).get();
+      s += mCanPlay ? "', can play" : "', cannot play";
+      if (mWMFFailedToLoad) {
+        s += ", Windows platform decoder failed to load";
+      }
+      if (mFFmpegFailedToLoad) {
+        s += ", Linux platform decoder failed to load";
+      }
+      if (mGMPPDMFailedToStartup) {
+        s += ", GMP PDM failed to startup";
+      } else if (!mGMP.IsEmpty()) {
+        s += ", Using GMP '";
+        s += mGMP;
+        s += "'";
+      }
       break;
-    }
-    break;
+    case eMediaKeySystemAccessRequest:
+      s = "key system='";
+      s += NS_ConvertUTF16toUTF8(mKeySystem).get();
+      s += mIsKeySystemSupported ? "', supported" : "', not supported";
+      switch (mKeySystemIssue) {
+        case eUnset:
+          break;
+        case eWidevineWithNoWMF:
+          s += ", Widevine with no WMF";
+          break;
+      }
+      break;
     default:
       s = "?";
       break;
   }
   return s;
 }
 
 } // namespace mozilla