0

Avoid string_view -> string conversion for base::UmaHistogram* functions

Now that string_view is supported for these functions, we can remove a
few explicit conversions. This should be a no-op.

Bug: 358538894
Change-Id: I83136da3f89169ba6df49fdcbdc9568afc44f886
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5783695
Reviewed-by: Alexei Svitkine <asvitkine@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Alex Turner <alexmt@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1340698}
This commit is contained in:
Alex Turner
2024-08-12 23:38:23 +00:00
committed by Chromium LUCI CQ
parent 704de59c3f
commit 0b7e4dd555
7 changed files with 12 additions and 16 deletions
ash
chrome/browser/ui/views/download/bubble
components/safe_search_api
content/browser/private_aggregation
media/mojo/services

@ -86,19 +86,19 @@ bool URLChecker::CheckURL(const GURL& url, CheckCallback callback) {
<< " safe; certain: " << !result.uncertain;
std::move(callback).Run(url, result.classification, result.uncertain);
base::UmaHistogramEnumeration(std::string(kCacheHitMetricKey),
base::UmaHistogramEnumeration(kCacheHitMetricKey,
CacheAccessStatus::kHit);
return true;
}
DVLOG(1) << "Outdated cache entry for " << url.spec() << ", purging";
cache_.Erase(cache_it);
base::UmaHistogramEnumeration(std::string(kCacheHitMetricKey),
base::UmaHistogramEnumeration(kCacheHitMetricKey,
CacheAccessStatus::kOutdated);
MaybeScheduleAsyncCheck(url, std::move(callback));
return false;
}
base::UmaHistogramEnumeration(std::string(kCacheHitMetricKey),
base::UmaHistogramEnumeration(kCacheHitMetricKey,
CacheAccessStatus::kNotFound);
MaybeScheduleAsyncCheck(url, std::move(callback));
return false;