Bug 1693541 - Improve uses of nsBaseHashtable and descendants and avoid multiple subsequent lookups in toolkit/components/perfmonitoring. r=florian

Differential Revision: https://phabricator.services.mozilla.com/D106114
This commit is contained in:
Simon Giesecke 2021-02-26 11:36:40 +00:00
Родитель ee037ba882
Коммит a47a075987
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -242,14 +242,15 @@ PerformanceMetricsCollector::RequestMetricsInternal() {
LOG(("[%s] Expecting %d results back", nsIDToCString(uuid).get(),
numResultsRequired));
results->SetNumResultsRequired(numResultsRequired);
mAggregatedResults.InsertOrUpdate(uuid, std::move(results));
const auto& aggregatedResult =
mAggregatedResults.InsertOrUpdate(uuid, std::move(results));
// calling all content processes via IPDL (async)
for (uint32_t i = 0; i < numChildren; i++) {
if (NS_WARN_IF(!children[i]->SendRequestPerformanceMetrics(uuid))) {
LOG(("[%s] Failed to send request to child %d", nsIDToCString(uuid).get(),
i));
mAggregatedResults.GetValue(uuid)->get()->Abort(NS_ERROR_FAILURE);
aggregatedResult->Abort(NS_ERROR_FAILURE);
return RequestMetricsPromise::CreateAndReject(NS_ERROR_FAILURE, __func__);
}
LOG(("[%s] Request sent to child %d", nsIDToCString(uuid).get(), i));