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..6fbf87017cfcbf7d6cefae7a7b2d15fa49e796b4 100644 |
--- a/chrome/browser/chrome_browser_field_trials.cc |
+++ b/chrome/browser/chrome_browser_field_trials.cc |
@@ -8,12 +8,15 @@ |
#include "base/command_line.h" |
#include "base/feature_list.h" |
+#include "base/files/file_path.h" |
#include "base/metrics/field_trial.h" |
#include "base/metrics/histogram_base.h" |
#include "base/metrics/persistent_histogram_allocator.h" |
+#include "base/path_service.h" |
#include "base/strings/string_util.h" |
#include "base/time/time.h" |
#include "build/build_config.h" |
+#include "chrome/common/chrome_paths.h" |
#include "chrome/common/chrome_switches.h" |
#include "components/metrics/metrics_pref_names.h" |
@@ -39,6 +42,20 @@ void InstantiatePersistentHistograms() { |
kAllocatorName); |
Ilya Sherman
2016/04/20 17:10:33
Could you pass the destination file name here, so
bcwhite
2016/04/22 15:18:05
This has been moved to it's rightful final resting
Ilya Sherman
2016/04/25 19:48:40
Is there not an embedder interface that could be u
bcwhite
2016/04/25 20:37:17
I don't understand what you mean by that.
Ilya Sherman
2016/04/25 21:12:10
For example, the ChromeMetricsServiceClient class
bcwhite
2016/04/26 13:32:29
When things can be instantiated at any time, that'
Ilya Sherman
2016/04/26 20:01:24
Hmm, I guess I didn't look very carefully at where
bcwhite
2016/04/26 21:04:26
It's important to start it as early as possible so
Ilya Sherman
2016/04/27 20:31:33
Are there actually histograms that are recorded be
|
base::GlobalHistogramAllocator::Get()->CreateTrackingHistograms( |
kAllocatorName); |
+ |
+ // Set the destination for where these will be persisted. This shouldn't |
+ // be necessary because it's done in chrome_metrics_service_client.cc where |
+ // the reading of this file is configured but field trials don't get done |
+ // until after that point so there is no global allocator to configure |
+ // when that code runs. This won't be a problem when this (eventually) |
+ // becomes standard and is enabled during early startup. |
+ base::FilePath metrics_file; |
+ if (base::PathService::Get(chrome::DIR_USER_DATA, &metrics_file)) { |
+ metrics_file = metrics_file.AppendASCII(kAllocatorName) |
+ .AddExtension(FILE_PATH_LITERAL(".pma")); |
+ base::GlobalHistogramAllocator::Get() |
+ ->SetPersistentLocation(metrics_file); |
+ } |
} |
} |