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 c867c27f30fc36fd14ce8270a654f4d426cd6ec4..9906dc223522a67fd43f70d6f003fb6be6f11621 100644 |
| --- a/chrome/browser/metrics/chrome_metrics_service_client.cc |
| +++ b/chrome/browser/metrics/chrome_metrics_service_client.cc |
| @@ -87,6 +87,7 @@ |
| #if defined(OS_WIN) |
| #include <windows.h> |
| +#include "chrome/browser/metrics/antivirus_metrics_provider_win.h" |
| #include "chrome/browser/metrics/google_update_metrics_provider_win.h" |
| #include "chrome/common/metrics_constants_util_win.h" |
| #include "chrome/installer/util/browser_distribution.h" |
| @@ -445,6 +446,13 @@ void ChromeMetricsServiceClient::Initialize() { |
| new browser_watcher::WatcherMetricsProviderWin( |
| chrome::GetBrowserExitCodesRegistryPath(), |
| content::BrowserThread::GetBlockingPool()))); |
| + |
| + antivirus_metrics_provider_ = new AntiVirusMetricsProvider( |
| + content::BrowserThread::GetMessageLoopProxyForThread( |
| + content::BrowserThread::FILE)); |
|
Alexei Svitkine (slow)
2016/06/03 15:48:34
Any reason to use FILE instead of the worker pool?
Will Harris
2016/06/03 20:51:30
I was using the same thread that GetDriveMetrics r
|
| + |
| + metrics_service_->RegisterMetricsProvider( |
| + std::unique_ptr<metrics::MetricsProvider>(antivirus_metrics_provider_)); |
| #endif // defined(OS_WIN) |
| #if defined(ENABLE_PLUGINS) |
| @@ -523,6 +531,18 @@ void ChromeMetricsServiceClient::OnInitTaskGotPluginInfo() { |
| } |
| void ChromeMetricsServiceClient::OnInitTaskGotGoogleUpdateData() { |
| + const base::Closure got_metrics_callback = |
| + base::Bind(&ChromeMetricsServiceClient::OnInitTaskGotAntiVirusData, |
| + weak_ptr_factory_.GetWeakPtr()); |
| + |
| +#if defined(OS_WIN) |
| + antivirus_metrics_provider_->GetAntiVirusMetrics(got_metrics_callback); |
| +#else |
| + got_metrics_callback.Run(); |
| +#endif // defined(OS_WIN) |
| +} |
| + |
| +void ChromeMetricsServiceClient::OnInitTaskGotAntiVirusData() { |
| drive_metrics_provider_->GetDriveMetrics( |
| base::Bind(&ChromeMetricsServiceClient::OnInitTaskGotDriveMetrics, |
| weak_ptr_factory_.GetWeakPtr())); |