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

Unified Diff: chrome/browser/metrics/chrome_metrics_service_client.cc

Issue 2009773007: Add AntiVirus information to the system profile. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: code review fixes part 2 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
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()));

Powered by Google App Engine
This is Rietveld 408576698