зеркало из https://github.com/mozilla/gecko-dev.git
Backout bug 1350765 for having caused bug 1358259
This commit is contained in:
Родитель
b007d78f5d
Коммит
cd4aaca3e8
|
@ -570,10 +570,12 @@ GetProcessFromName(const std::string& aString)
|
|||
}
|
||||
|
||||
Histogram*
|
||||
internal_GetSubsessionHistogram(mozilla::Telemetry::HistogramID id,
|
||||
Histogram& existing)
|
||||
internal_GetSubsessionHistogram(Histogram& existing)
|
||||
{
|
||||
if (gHistograms[id].keyed) {
|
||||
mozilla::Telemetry::HistogramID id;
|
||||
nsresult rv
|
||||
= internal_GetHistogramEnumId(existing.histogram_name().c_str(), &id);
|
||||
if (NS_FAILED(rv) || gHistograms[id].keyed) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@ -616,23 +618,10 @@ internal_GetSubsessionHistogram(mozilla::Telemetry::HistogramID id,
|
|||
cache[id] = clone;
|
||||
return clone;
|
||||
}
|
||||
|
||||
Histogram*
|
||||
internal_GetSubsessionHistogram(Histogram& existing)
|
||||
{
|
||||
mozilla::Telemetry::HistogramID id;
|
||||
nsresult rv
|
||||
= internal_GetHistogramEnumId(existing.histogram_name().c_str(), &id);
|
||||
if (NS_FAILED(rv)) {
|
||||
return nullptr;
|
||||
}
|
||||
return internal_GetSubsessionHistogram(id, existing);
|
||||
}
|
||||
#endif
|
||||
|
||||
nsresult
|
||||
internal_HistogramAdd(mozilla::Telemetry::HistogramID id,
|
||||
Histogram& histogram, int32_t value, uint32_t dataset)
|
||||
internal_HistogramAdd(Histogram& histogram, int32_t value, uint32_t dataset)
|
||||
{
|
||||
// Check if we are allowed to record the data.
|
||||
bool canRecordDataset = CanRecordDataset(dataset,
|
||||
|
@ -643,7 +632,7 @@ internal_HistogramAdd(mozilla::Telemetry::HistogramID id,
|
|||
}
|
||||
|
||||
#if !defined(MOZ_WIDGET_ANDROID)
|
||||
if (Histogram* subsession = internal_GetSubsessionHistogram(id, histogram)) {
|
||||
if (Histogram* subsession = internal_GetSubsessionHistogram(histogram)) {
|
||||
subsession->Add(value);
|
||||
}
|
||||
#endif
|
||||
|
@ -656,17 +645,24 @@ internal_HistogramAdd(mozilla::Telemetry::HistogramID id,
|
|||
}
|
||||
|
||||
nsresult
|
||||
internal_HistogramAdd(mozilla::Telemetry::HistogramID id,
|
||||
Histogram& histogram, int32_t value)
|
||||
internal_HistogramAdd(Histogram& histogram, int32_t value)
|
||||
{
|
||||
uint32_t dataset = nsITelemetry::DATASET_RELEASE_CHANNEL_OPTIN;
|
||||
// We only really care about the dataset of the histogram if we are not recording
|
||||
// extended telemetry. Otherwise, we always record histogram data.
|
||||
if (!internal_CanRecordExtended()) {
|
||||
mozilla::Telemetry::HistogramID id;
|
||||
nsresult rv
|
||||
= internal_GetHistogramEnumId(histogram.histogram_name().c_str(), &id);
|
||||
if (NS_FAILED(rv)) {
|
||||
// If we can't look up the dataset, it might be because the histogram was added
|
||||
// at runtime. Since we're not recording extended telemetry, bail out.
|
||||
return NS_OK;
|
||||
}
|
||||
dataset = gHistograms[id].dataset;
|
||||
}
|
||||
|
||||
return internal_HistogramAdd(id, histogram, value, dataset);
|
||||
return internal_HistogramAdd(histogram, value, dataset);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1204,7 +1200,7 @@ void internal_Accumulate(mozilla::Telemetry::HistogramID aHistogram, uint32_t aS
|
|||
Histogram *h;
|
||||
nsresult rv = internal_GetHistogramByEnumId(aHistogram, &h, GeckoProcessType_Default);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
internal_HistogramAdd(aHistogram, *h, aSample, gHistograms[aHistogram].dataset);
|
||||
internal_HistogramAdd(*h, aSample, gHistograms[aHistogram].dataset);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1226,14 +1222,14 @@ internal_Accumulate(mozilla::Telemetry::HistogramID aID,
|
|||
void
|
||||
internal_Accumulate(Histogram& aHistogram, uint32_t aSample)
|
||||
{
|
||||
if (XRE_IsParentProcess()) {
|
||||
internal_HistogramAdd(aHistogram, aSample);
|
||||
return;
|
||||
}
|
||||
|
||||
mozilla::Telemetry::HistogramID id;
|
||||
nsresult rv = internal_GetHistogramEnumId(aHistogram.histogram_name().c_str(), &id);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
if (XRE_IsParentProcess()) {
|
||||
internal_HistogramAdd(id, aHistogram, aSample);
|
||||
return;
|
||||
}
|
||||
|
||||
internal_RemoteAccumulate(id, aSample);
|
||||
}
|
||||
}
|
||||
|
@ -1262,7 +1258,7 @@ internal_AccumulateChild(GeckoProcessType aProcessType, mozilla::Telemetry::Hist
|
|||
Histogram* h;
|
||||
nsresult rv = internal_GetHistogramByEnumId(aId, &h, aProcessType);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
internal_HistogramAdd(aId, *h, aSample, gHistograms[aId].dataset);
|
||||
internal_HistogramAdd(*h, aSample, gHistograms[aId].dataset);
|
||||
} else {
|
||||
NS_WARNING("NS_FAILED GetHistogramByEnumId for CHILD");
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче