Chromium Code Reviews| Index: chrome/browser/metrics/chrome_metrics_service_client.cc |
| diff --git a/chrome/browser/metrics/chrome_metrics_service_client.cc b/chrome/browser/metrics/chrome_metrics_service_client.cc |
| index d980cd98e78afe021b813522d49ddbd23d5cbaee..91cf8892bdf142cf6dbaa8b6fc60024ffaf90d43 100644 |
| --- a/chrome/browser/metrics/chrome_metrics_service_client.cc |
| +++ b/chrome/browser/metrics/chrome_metrics_service_client.cc |
| @@ -32,8 +32,10 @@ |
| #include "chrome/common/chrome_switches.h" |
| #include "chrome/common/crash_keys.h" |
| #include "chrome/common/features.h" |
| +#include "chrome/installer/util/util_constants.h" |
| #include "components/metrics/call_stack_profile_metrics_provider.h" |
| #include "components/metrics/drive_metrics_provider.h" |
| +#include "components/metrics/file_metrics_provider.h" |
| #include "components/metrics/gpu/gpu_metrics_provider.h" |
| #include "components/metrics/metrics_pref_names.h" |
| #include "components/metrics/metrics_service.h" |
| @@ -177,6 +179,9 @@ void ChromeMetricsServiceClient::RegisterPrefs(PrefRegistrySimple* registry) { |
| metrics::MetricsService::RegisterPrefs(registry); |
| metrics::StabilityMetricsHelper::RegisterPrefs(registry); |
| + metrics::FileMetricsProvider::RegisterPrefs( |
| + registry, installer::kSetupHistogramAllocatorName); |
| + |
| #if BUILDFLAG(ANDROID_JAVA_UI) |
| AndroidMetricsProvider::RegisterPrefs(registry); |
| #endif // BUILDFLAG(ANDROID_JAVA_UI) |
| @@ -335,6 +340,19 @@ void ChromeMetricsServiceClient::Initialize() { |
| scoped_ptr<metrics::MetricsProvider>( |
| new metrics::ScreenInfoMetricsProvider)); |
| +#if defined(OS_WIN) |
| + scoped_ptr<metrics::FileMetricsProvider> file_metrics( |
| + new metrics::FileMetricsProvider(metrics_service_.get(), |
| + g_browser_process->local_state())); |
| + file_metrics->RegisterFile( |
| + base::CommandLine::ForCurrentProcess()->GetProgram().DirName() |
|
grt (UTC plus 2)
2016/02/08 18:09:18
use base::PathService::Get(base::DIR_EXE, &dir) in
bcwhite
2016/02/09 21:08:45
Done.
|
| + .AppendASCII(installer::kSetupHistogramAllocatorName) |
| + .AddExtension(L".pma"), |
|
Alexei Svitkine (slow)
2016/02/09 19:48:15
Can this logic be somewhere outside this file? See
grt (UTC plus 2)
2016/02/15 15:42:39
ping
bcwhite
2016/02/15 19:22:10
How about just a constant that has both the file n
Alexei Svitkine (slow)
2016/02/17 21:55:35
Sorry, in this comment I meant all the stuff to in
bcwhite
2016/02/18 01:46:56
As in
class FileMetricsProvider {
...
static sco
Alexei Svitkine (slow)
2016/02/18 15:50:32
Sorry, not exactly what I meant. I mean not having
bcwhite
2016/02/18 19:35:01
Done.
|
| + metrics::FileMetricsProvider::FILE_HISTOGRAMS_ATOMIC, |
| + installer::kSetupHistogramAllocatorName); |
| + metrics_service_->RegisterMetricsProvider(std::move(file_metrics)); |
| +#endif |
| + |
| drive_metrics_provider_ = new metrics::DriveMetricsProvider( |
| content::BrowserThread::GetMessageLoopProxyForThread( |
| content::BrowserThread::FILE), |
| @@ -523,7 +541,7 @@ void ChromeMetricsServiceClient::OnMemoryDetailCollectionDone() { |
| } |
| #endif // !ENABLE_PRINT_PREVIEW |
| - // Set up the callback to task to call after we receive histograms from all |
| + // Set up the callback task to call after we receive histograms from all |
| // child processes. |timeout| specifies how long to wait before absolutely |
| // calling us back on the task. |
| content::FetchHistogramsAsynchronously(base::MessageLoop::current(), callback, |