Bug 1392868 - Completely remove AutoCollectVsyncTelemetry on late beta. r?froydnj draft
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 23 Aug 2017 11:52:12 +0900
changeset 650963 153b51ecc392bdb865bc8bf6f0df86716189c806
parent 650941 7c50f0c999c5bf8ee915261997597a5a9b8fb2ae
child 727538 20dc7f984f838926a231a400bac43c479affbb46
push id75538
push userbmo:mh+mozilla@glandium.org
push dateWed, 23 Aug 2017 02:54:11 +0000
reviewersfroydnj
bugs1392868
milestone57.0a1
Bug 1392868 - Completely remove AutoCollectVsyncTelemetry on late beta. r?froydnj The class, in practice, was already doing nothing in that case, but with it being half #ifdef'ed on EARLY_BETA_OR_EARLIER, that led to build failures for unused code on late beta. Just remove the class completely on late beta.
xpcom/threads/SchedulerGroup.cpp
--- a/xpcom/threads/SchedulerGroup.cpp
+++ b/xpcom/threads/SchedulerGroup.cpp
@@ -49,36 +49,33 @@ public:
 private:
   ~SchedulerEventTarget() {}
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(SchedulerEventTarget, NS_DISPATCHEREVENTTARGET_IID)
 
 static Atomic<uint64_t> gEarliestUnprocessedVsync(0);
 
+#ifdef EARLY_BETA_OR_EARLIER
 class MOZ_RAII AutoCollectVsyncTelemetry final
 {
 public:
   explicit AutoCollectVsyncTelemetry(SchedulerGroup::Runnable* aRunnable
                                      MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
     : mIsBackground(aRunnable->IsBackground())
   {
     MOZ_GUARD_OBJECT_NOTIFIER_INIT;
-#ifdef EARLY_BETA_OR_EARLIER
     aRunnable->GetName(mKey);
     mStart = TimeStamp::Now();
-#endif
   }
   ~AutoCollectVsyncTelemetry()
   {
-#ifdef EARLY_BETA_OR_EARLIER
     if (Telemetry::CanRecordBase()) {
       CollectTelemetry();
     }
-#endif
   }
 
 private:
   void CollectTelemetry();
 
   bool mIsBackground;
   nsCString mKey;
   TimeStamp mStart;
@@ -122,16 +119,17 @@ AutoCollectVsyncTelemetry::CollectTeleme
   Telemetry::Accumulate(totalId, duration);
 
   if (pendingVsync > mStart) {
     return;
   }
 
   Telemetry::Accumulate(Telemetry::CONTENT_JS_KNOWN_TICK_DELAY_MS, duration);
 }
+#endif
 
 } // namespace
 
 NS_IMPL_ISUPPORTS(SchedulerEventTarget,
                   SchedulerEventTarget,
                   nsIEventTarget,
                   nsISerialEventTarget)
 
@@ -378,17 +376,19 @@ SchedulerGroup::Runnable::Run()
 {
   MOZ_RELEASE_ASSERT(NS_IsMainThread());
 
   mGroup->SetValidatingAccess(StartValidation);
 
   nsresult result;
 
   {
+#ifdef EARLY_BETA_OR_EARLIER
     AutoCollectVsyncTelemetry telemetry(this);
+#endif
     result = mRunnable->Run();
   }
 
   // The runnable's destructor can have side effects, so try to execute it in
   // the scope of the TabGroup.
   mRunnable = nullptr;
 
   mGroup->SetValidatingAccess(EndValidation);