Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2118)

Unified Diff: chrome/browser/chrome_browser_field_trials.cc

Issue 1891913002: Support saving browser metrics to disk and reading them during next run. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed some unnecessary includes Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/metrics/sparse_histogram.cc ('k') | chrome/browser/metrics/chrome_metrics_service_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_browser_field_trials.cc
diff --git a/chrome/browser/chrome_browser_field_trials.cc b/chrome/browser/chrome_browser_field_trials.cc
index 648167695f6b70b9ca8b5c986e7c773d7d08c2ca..a839e144222bd171dda462a3f4fb5ba9f7c73f58 100644
--- a/chrome/browser/chrome_browser_field_trials.cc
+++ b/chrome/browser/chrome_browser_field_trials.cc
@@ -26,19 +26,14 @@
namespace {
// Check for feature enabling the use of persistent histogram storage and
-// create an appropriate allocator for such if so.
+// enable the global allocator if so.
void InstantiatePersistentHistograms() {
if (base::FeatureList::IsEnabled(base::kPersistentHistogramsFeature)) {
- const char kAllocatorName[] = "BrowserMetrics";
- // Create persistent/shared memory and allow histograms to be stored in it.
- // Memory that is not actualy used won't be physically mapped by the system.
- // BrowserMetrics usage peaked around 95% of 2MiB as of 2016-02-20.
- base::GlobalHistogramAllocator::CreateWithLocalMemory(
- 3 << 20, // 3 MiB
- 0x935DDD43, // SHA1(BrowserMetrics)
- kAllocatorName);
- base::GlobalHistogramAllocator::Get()->CreateTrackingHistograms(
- kAllocatorName);
+ base::GlobalHistogramAllocator::Enable();
+ base::GlobalHistogramAllocator* allocator =
+ base::GlobalHistogramAllocator::Get();
+ DCHECK(allocator); // Should have been created during startup.
+ allocator->CreateTrackingHistograms(allocator->Name());
}
}
« no previous file with comments | « base/metrics/sparse_histogram.cc ('k') | chrome/browser/metrics/chrome_metrics_service_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698