зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1260908 - Allow keyed histograms to accumulate early in startup (r=gfritzsche)
This commit is contained in:
Родитель
683c7a418e
Коммит
2471ddff5c
|
@ -703,6 +703,7 @@ class TelemetryImpl final
|
|||
public:
|
||||
void InitMemoryReporter();
|
||||
|
||||
static bool IsInitialized();
|
||||
static bool CanRecordBase();
|
||||
static bool CanRecordExtended();
|
||||
static already_AddRefed<nsITelemetry> CreateTelemetryInstance();
|
||||
|
@ -3309,6 +3310,12 @@ TelemetryImpl::SetCanRecordBase(bool canRecord) {
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
/* static */ bool
|
||||
TelemetryImpl::IsInitialized()
|
||||
{
|
||||
return sTelemetry;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates if Telemetry can record base data (FHR data). This is true if the
|
||||
* FHR data reporting service or self-support are enabled.
|
||||
|
@ -3902,7 +3909,7 @@ Accumulate(ID aHistogram, uint32_t aSample)
|
|||
void
|
||||
Accumulate(ID aID, const nsCString& aKey, uint32_t aSample)
|
||||
{
|
||||
if (!TelemetryImpl::CanRecordBase()) {
|
||||
if (!TelemetryImpl::IsInitialized() || !TelemetryImpl::CanRecordBase()) {
|
||||
return;
|
||||
}
|
||||
const TelemetryHistogram& th = gHistograms[aID];
|
||||
|
|
Загрузка…
Ссылка в новой задаче