Bug 1356898 - Use nsAutoCString in two places in TelemetryHistogram.cpp. r?froydnj
MozReview-Commit-ID: 3njPBvdhwRj
--- a/toolkit/components/telemetry/TelemetryHistogram.cpp
+++ b/toolkit/components/telemetry/TelemetryHistogram.cpp
@@ -494,17 +494,17 @@ internal_GetHistogramByEnumId(mozilla::T
return NS_OK;
}
const HistogramInfo &p = gHistograms[id];
if (p.keyed) {
return NS_ERROR_FAILURE;
}
- nsCString histogramName;
+ nsAutoCString histogramName;
histogramName.Append(p.id());
if (const char* suffix = SuffixForProcessType(aProcessType)) {
histogramName.AppendASCII(suffix);
}
nsresult rv = internal_HistogramGet(histogramName.get(), p.expiration(),
p.histogramType, p.min, p.max,
p.bucketCount, true, &h);
@@ -1398,17 +1398,17 @@ internal_AccumulateChildKeyed(GeckoProce
const char* suffix = SuffixForProcessType(aProcessType);
if (!suffix) {
MOZ_ASSERT_UNREACHABLE("suffix should not be null");
return;
}
const HistogramInfo& th = gHistograms[aId];
- nsCString id;
+ nsAutoCString id;
id.Append(th.id());
id.AppendASCII(suffix);
KeyedHistogram* keyed = internal_GetKeyedHistogramById(id);
MOZ_ASSERT(keyed);
keyed->Add(aKey, aSample);
}