Bug 1944631 - remove remaining legacy telemetry references in dom/media, r=media-playback-reviewers,alwu,TravisLong.
Differential Revision: https://phabricator.services.mozilla.com/D235956
This commit is contained in:
@@ -16,7 +16,6 @@
|
||||
#include "mozilla/Sprintf.h"
|
||||
#include "mozilla/Unused.h"
|
||||
#include <algorithm>
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "CubebUtils.h"
|
||||
#include "nsNativeCharsetUtils.h"
|
||||
#include "nsPrintfCString.h"
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#include "mozilla/StaticMutex.h"
|
||||
#include "mozilla/StaticPrefs_media.h"
|
||||
#include "mozilla/TaskQueue.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "mozilla/dom/ContentChild.h"
|
||||
#include "mozilla/gfx/gfxVars.h"
|
||||
#include "nsGkAtoms.h"
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#include "mozilla/StaticPtr.h"
|
||||
#include "mozilla/StaticPrefs_browser.h"
|
||||
#include "mozilla/StaticPrefs_media.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsINetworkLinkService.h"
|
||||
#include "nsIObserverService.h"
|
||||
|
||||
@@ -37,7 +37,6 @@
|
||||
#include "mozilla/Sprintf.h"
|
||||
#include "mozilla/StaticPrefs_media.h"
|
||||
#include "mozilla/TaskQueue.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "nsIMemoryReporter.h"
|
||||
#include "nsPrintfCString.h"
|
||||
#include "nsTArray.h"
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
# include "GLImages.h" // for SurfaceTextureImage
|
||||
#endif
|
||||
#include "MediaDecoderOwner.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "mozilla/AbstractThread.h"
|
||||
|
||||
using namespace mozilla::layers;
|
||||
@@ -18,27 +17,6 @@ using namespace mozilla::layers;
|
||||
namespace mozilla {
|
||||
#define NS_DispatchToMainThread(...) CompileError_UseAbstractMainThreadInstead
|
||||
|
||||
namespace {
|
||||
template <Telemetry::HistogramID ID>
|
||||
class AutoTimer {
|
||||
// Set a threshold to reduce performance overhead
|
||||
// for we're measuring hot spots.
|
||||
static const uint32_t sThresholdMS = 1000;
|
||||
|
||||
public:
|
||||
~AutoTimer() {
|
||||
auto end = TimeStamp::Now();
|
||||
auto diff = uint32_t((end - mStart).ToMilliseconds());
|
||||
if (diff > sThresholdMS) {
|
||||
Telemetry::Accumulate(ID, diff);
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
const TimeStamp mStart = TimeStamp::Now();
|
||||
};
|
||||
} // namespace
|
||||
|
||||
VideoFrameContainer::VideoFrameContainer(
|
||||
MediaDecoderOwner* aOwner, already_AddRefed<ImageContainer> aContainer)
|
||||
: mOwner(aOwner),
|
||||
|
||||
@@ -14,26 +14,13 @@ namespace mozilla::dom {
|
||||
|
||||
DetailedPromise::DetailedPromise(nsIGlobalObject* aGlobal,
|
||||
const nsACString& aName)
|
||||
: Promise(aGlobal),
|
||||
mName(aName),
|
||||
mResponded(false),
|
||||
mStartTime(TimeStamp::Now()) {}
|
||||
|
||||
DetailedPromise::DetailedPromise(nsIGlobalObject* aGlobal,
|
||||
const nsACString& aName,
|
||||
Telemetry::HistogramID aSuccessLatencyProbe,
|
||||
Telemetry::HistogramID aFailureLatencyProbe)
|
||||
: DetailedPromise(aGlobal, aName) {
|
||||
mSuccessLatencyProbe.Construct(aSuccessLatencyProbe);
|
||||
mFailureLatencyProbe.Construct(aFailureLatencyProbe);
|
||||
}
|
||||
: Promise(aGlobal), mName(aName), mStartTime(TimeStamp::Now()) {}
|
||||
|
||||
DetailedPromise::~DetailedPromise() {
|
||||
// It would be nice to assert that mResponded is identical to
|
||||
// GetPromiseState() == PromiseState::Rejected. But by now we've been
|
||||
// unlinked, so don't have a reference to our actual JS Promise object
|
||||
// anymore.
|
||||
MaybeReportTelemetry(kFailed);
|
||||
}
|
||||
|
||||
void DetailedPromise::LogRejectionReason(uint32_t aErrorCode,
|
||||
@@ -42,8 +29,6 @@ void DetailedPromise::LogRejectionReason(uint32_t aErrorCode,
|
||||
aErrorCode, PromiseFlatCString(aReason).get());
|
||||
EME_LOG("%s", msg.get());
|
||||
|
||||
MaybeReportTelemetry(kFailed);
|
||||
|
||||
LogToBrowserConsole(NS_ConvertUTF8toUTF16(msg));
|
||||
}
|
||||
|
||||
@@ -67,21 +52,4 @@ already_AddRefed<DetailedPromise> DetailedPromise::Create(
|
||||
return aRv.Failed() ? nullptr : promise.forget();
|
||||
}
|
||||
|
||||
void DetailedPromise::MaybeReportTelemetry(eStatus aStatus) {
|
||||
if (mResponded) {
|
||||
return;
|
||||
}
|
||||
mResponded = true;
|
||||
if (!mSuccessLatencyProbe.WasPassed() || !mFailureLatencyProbe.WasPassed()) {
|
||||
return;
|
||||
}
|
||||
uint32_t latency = (TimeStamp::Now() - mStartTime).ToMilliseconds();
|
||||
EME_LOG("%s %s latency %ums reported via telemetry", mName.get(),
|
||||
((aStatus == kSucceeded) ? "succcess" : "failure"), latency);
|
||||
Telemetry::HistogramID tid = (aStatus == kSucceeded)
|
||||
? mSuccessLatencyProbe.Value()
|
||||
: mFailureLatencyProbe.Value();
|
||||
Telemetry::Accumulate(tid, latency);
|
||||
}
|
||||
|
||||
} // namespace mozilla::dom
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
#define __DetailedPromise_h__
|
||||
|
||||
#include "mozilla/dom/Promise.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "EMEUtils.h"
|
||||
|
||||
namespace mozilla::dom {
|
||||
@@ -27,7 +26,6 @@ class DetailedPromise : public Promise {
|
||||
template <typename T>
|
||||
void MaybeResolve(T&& aArg) {
|
||||
EME_LOG("%s promise resolved", mName.get());
|
||||
MaybeReportTelemetry(eStatus::kSucceeded);
|
||||
Promise::MaybeResolve(std::forward<T>(aArg));
|
||||
}
|
||||
|
||||
@@ -83,20 +81,13 @@ class DetailedPromise : public Promise {
|
||||
private:
|
||||
explicit DetailedPromise(nsIGlobalObject* aGlobal, const nsACString& aName);
|
||||
|
||||
explicit DetailedPromise(nsIGlobalObject* aGlobal, const nsACString& aName,
|
||||
Telemetry::HistogramID aSuccessLatencyProbe,
|
||||
Telemetry::HistogramID aFailureLatencyProbe);
|
||||
virtual ~DetailedPromise();
|
||||
|
||||
enum eStatus { kSucceeded, kFailed };
|
||||
void MaybeReportTelemetry(eStatus aStatus);
|
||||
void LogRejectionReason(uint32_t aErrorCode, const nsACString& aReason);
|
||||
|
||||
nsCString mName;
|
||||
bool mResponded;
|
||||
TimeStamp mStartTime;
|
||||
Optional<Telemetry::HistogramID> mSuccessLatencyProbe;
|
||||
Optional<Telemetry::HistogramID> mFailureLatencyProbe;
|
||||
};
|
||||
|
||||
} // namespace mozilla::dom
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
#include "GMPCrashHelper.h"
|
||||
#include "mozilla/EMEUtils.h"
|
||||
#include "mozilla/JSONStringWriteFuncs.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "mozilla/dom/DOMException.h"
|
||||
#include "mozilla/dom/Document.h"
|
||||
#include "mozilla/dom/HTMLMediaElement.h"
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
#include "mozilla/ProfilerLabels.h"
|
||||
#include "mozilla/RollingMean.h"
|
||||
#include "VideoUtils.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
#include "mozilla/SpinEventLoopUntil.h"
|
||||
#include "mozilla/StaticPrefs_media.h"
|
||||
#include "mozilla/SyncRunnable.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "mozilla/Unused.h"
|
||||
#if defined(XP_WIN)
|
||||
# include "mozilla/UntrustedModulesData.h"
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
#include "RemoteDecoderManagerParent.h"
|
||||
#include "RemoteImageHolder.h"
|
||||
#include "mozilla/StaticPrefs_media.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "mozilla/layers/ImageClient.h"
|
||||
#include "mozilla/layers/TextureClient.h"
|
||||
#include "mozilla/layers/VideoBridgeChild.h"
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
#include "MediaControlUtils.h"
|
||||
#include "mozilla/ClearOnShutdown.h"
|
||||
#include "mozilla/StaticPtr.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "mozilla/ToString.h"
|
||||
#include "mozilla/dom/BrowsingContext.h"
|
||||
#include "mozilla/dom/CanonicalBrowsingContext.h"
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#include "mozilla/dom/MediaSession.h"
|
||||
#include "mozilla/dom/Navigator.h"
|
||||
#include "mozilla/dom/WindowContext.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "nsFocusManager.h"
|
||||
|
||||
// avoid redefined macro in unified build
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#include "mozilla/Services.h"
|
||||
#include "mozilla/StaticPrefs_media.h"
|
||||
#include "mozilla/StaticPtr.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "nsIObserverService.h"
|
||||
#include "nsXULAppAPI.h"
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
#include "VPXDecoder.h"
|
||||
#include "mozilla/Span.h"
|
||||
#include "mozilla/StaticPrefs_media.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "nsPrintfCString.h"
|
||||
#include "SampleIterator.h"
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
#include "mozilla/EndianUtils.h"
|
||||
#include "mozilla/Logging.h"
|
||||
#include "mozilla/RefPtr.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "mozilla/UniquePtr.h"
|
||||
#include "VideoUtils.h"
|
||||
#include "MoofParser.h"
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
#include "mozilla/ScopeExit.h"
|
||||
#include "mozilla/SchedulerGroup.h"
|
||||
#include "mozilla/SharedThreadPool.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "mozilla/TimeStamp.h"
|
||||
#include "nsDebug.h"
|
||||
#include "nsAutoRef.h"
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
# include "libavutil/channel_layout.h"
|
||||
#endif
|
||||
#include "mozilla/StaticPrefs_media.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#include "WMFUtils.h"
|
||||
#include "mozilla/AbstractThread.h"
|
||||
#include "mozilla/Logging.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "nsTArray.h"
|
||||
#include "BufferReader.h"
|
||||
#include "mozilla/ScopeExit.h"
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#include "mozilla/ProfilerMarkers.h"
|
||||
#include "mozilla/SyncRunnable.h"
|
||||
#include "mozilla/TaskQueue.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "nsTArray.h"
|
||||
|
||||
#define LOG(...) MOZ_LOG(sPDMLog, mozilla::LogLevel::Debug, (__VA_ARGS__))
|
||||
|
||||
@@ -21,8 +21,6 @@
|
||||
#include "mozilla/dom/ScriptSettings.h"
|
||||
#include "mozilla/dom/WakeLock.h"
|
||||
#include "mozilla/dom/power/PowerManagerService.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "mozilla/TelemetryHistogramEnums.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsGlobalWindowInner.h"
|
||||
#include "Tracing.h"
|
||||
|
||||
Reference in New Issue
Block a user