Bug 1836191 - remove ChromeUtils.requestPerformanceMetrics that was only used by about:performance, r=smaug.

Differential Revision: https://phabricator.services.mozilla.com/D179696
This commit is contained in:
Florian Quèze
2023-06-08 21:53:18 +00:00
parent 85b4aac7f0
commit 0e354778bd
38 changed files with 0 additions and 1527 deletions

View File

@@ -23,7 +23,6 @@
#include "mozilla/EventStateManager.h"
#include "mozilla/FormAutofillNative.h"
#include "mozilla/IntentionalCrash.h"
#include "mozilla/PerformanceMetricsCollector.h"
#include "mozilla/PerfStats.h"
#include "mozilla/Preferences.h"
#include "mozilla/ProcInfo.h"
@@ -1475,35 +1474,6 @@ bool ChromeUtils::VsyncEnabled(GlobalObject& aGlobal) {
return mozilla::gfx::VsyncSource::GetFastestVsyncRate().isSome();
}
/* static */
already_AddRefed<Promise> ChromeUtils::RequestPerformanceMetrics(
GlobalObject& aGlobal, ErrorResult& aRv) {
MOZ_ASSERT(XRE_IsParentProcess());
// Creating a JS promise
nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(aGlobal.GetAsSupports());
MOZ_ASSERT(global);
RefPtr<Promise> domPromise = Promise::Create(global, aRv);
if (NS_WARN_IF(aRv.Failed())) {
return nullptr;
}
MOZ_ASSERT(domPromise);
RefPtr<nsISerialEventTarget> target =
global->EventTargetFor(TaskCategory::Performance);
// requesting metrics, that will be returned into the promise
PerformanceMetricsCollector::RequestMetrics()->Then(
target, __func__,
[domPromise,
target](nsTArray<dom::PerformanceInfoDictionary>&& aResults) {
domPromise->MaybeResolve(std::move(aResults));
},
[domPromise](const nsresult& aRv) { domPromise->MaybeReject(aRv); });
// sending back the promise instance
return domPromise.forget();
}
void ChromeUtils::SetPerfStatsCollectionMask(GlobalObject& aGlobal,
uint64_t aMask) {
PerfStats::SetCollectionMask(static_cast<PerfStats::MetricMask>(aMask));