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

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

Issue 2669923004: Use TaskScheduler instead of blocking pool in google_update_metrics_provider_win.cc. (Closed)
Patch Set: upload Created 3 years, 10 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/google_update_metrics_provider_win.cc
diff --git a/chrome/browser/metrics/google_update_metrics_provider_win.cc b/chrome/browser/metrics/google_update_metrics_provider_win.cc
index 5cf905cd524daaa66870f9b93f3745d26c18a535..3e50a421aa41037cead85119155e4fbb67a0c125 100644
--- a/chrome/browser/metrics/google_update_metrics_provider_win.cc
+++ b/chrome/browser/metrics/google_update_metrics_provider_win.cc
@@ -6,10 +6,9 @@
#include "base/location.h"
#include "base/single_thread_task_runner.h"
-#include "base/task_runner_util.h"
+#include "base/task_scheduler/post_task.h"
#include "base/threading/thread_task_runner_handle.h"
#include "components/metrics/proto/system_profile.pb.h"
-#include "content/public/browser/browser_thread.h"
typedef metrics::SystemProfileProto::GoogleUpdate::ProductInfo ProductInfo;
@@ -57,14 +56,12 @@ void GoogleUpdateMetricsProviderWin::GetGoogleUpdateData(
// Schedules a task on a blocking pool thread to gather Google Update
// statistics (requires Registry reads).
- base::PostTaskAndReplyWithResult(
- content::BrowserThread::GetBlockingPool(),
- FROM_HERE,
- base::Bind(
- &GoogleUpdateMetricsProviderWin::GetGoogleUpdateDataOnBlockingPool),
- base::Bind(
- &GoogleUpdateMetricsProviderWin::ReceiveGoogleUpdateData,
- weak_ptr_factory_.GetWeakPtr(), done_callback));
+ base::PostTaskWithTraitsAndReplyWithResult(
+ FROM_HERE, base::TaskTraits().MayBlock().WithPriority(
+ base::TaskPriority::BACKGROUND),
+ base::Bind(&GoogleUpdateMetricsProviderWin::GetGoogleUpdateDataBlocking),
+ base::Bind(&GoogleUpdateMetricsProviderWin::ReceiveGoogleUpdateData,
+ weak_ptr_factory_.GetWeakPtr(), done_callback));
}
void GoogleUpdateMetricsProviderWin::ProvideSystemProfileMetrics(
@@ -108,7 +105,7 @@ GoogleUpdateMetricsProviderWin::GoogleUpdateMetrics::~GoogleUpdateMetrics() {
// static
GoogleUpdateMetricsProviderWin::GoogleUpdateMetrics
-GoogleUpdateMetricsProviderWin::GetGoogleUpdateDataOnBlockingPool() {
+GoogleUpdateMetricsProviderWin::GetGoogleUpdateDataBlocking() {
GoogleUpdateMetrics google_update_metrics;
if (!IsOfficialBuild())

Powered by Google App Engine
This is Rietveld 408576698