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.
--- 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);