Bug 1343442 - Move NotificationAndReportStringId closer to first use - r?jya draft
authorGerald Squelart <gsquelart@mozilla.com>
Wed, 22 Mar 2017 15:37:41 +1100
changeset 560834 f61ae9e102c78c81e61b9b20692bea809fcb6511
parent 560833 738694f4e574d57c37f4c2f3cd31ad5e11d3348c
child 560835 6ba03a16ae03767aaee98116ce727446dc83d1fa
push id53551
push usergsquelart@mozilla.com
push dateTue, 11 Apr 2017 23:47:44 +0000
reviewersjya
bugs1343442
milestone55.0a1
Bug 1343442 - Move NotificationAndReportStringId closer to first use - r?jya MozReview-Commit-ID: IBn5jsHTsKx
dom/media/DecoderDoctorDiagnostics.cpp
--- a/dom/media/DecoderDoctorDiagnostics.cpp
+++ b/dom/media/DecoderDoctorDiagnostics.cpp
@@ -27,24 +27,16 @@
 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 {
 
-struct NotificationAndReportStringId
-{
-  // Notification type, handled by browser-media.js.
-  dom::DecoderDoctorNotificationType mNotificationType;
-  // Console message id. Key in dom/locales/.../chrome/dom/dom.properties.
-  const char* mReportStringId;
-};
-
 // 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
 // timer (if present), so no more work will happen and the watcher will be
@@ -242,16 +234,24 @@ DecoderDoctorDocumentWatcher::EnsureTime
     if (NS_WARN_IF(NS_FAILED(
           mTimer->InitWithCallback(
             this, sAnalysisPeriod_ms, nsITimer::TYPE_ONE_SHOT)))) {
       mTimer = nullptr;
     }
   }
 }
 
+struct NotificationAndReportStringId
+{
+  // Notification type, handled by browser-media.js.
+  dom::DecoderDoctorNotificationType mNotificationType;
+  // Console message id. Key in dom/locales/.../chrome/dom/dom.properties.
+  const char* mReportStringId;
+};
+
 // Note: ReportStringIds are limited to alphanumeric only.
 static const NotificationAndReportStringId sMediaWidevineNoWMF=
   { dom::DecoderDoctorNotificationType::Platform_decoder_not_found,
     "MediaWidevineNoWMF" };
 static const NotificationAndReportStringId sMediaWMFNeeded =
   { dom::DecoderDoctorNotificationType::Platform_decoder_not_found,
     "MediaWMFNeeded" };
 static const NotificationAndReportStringId sMediaPlatformDecoderNotFound =