Index: chrome/browser/metrics/chrome_metrics_services_manager_client.cc |
diff --git a/chrome/browser/metrics/chrome_metrics_services_manager_client.cc b/chrome/browser/metrics/chrome_metrics_services_manager_client.cc |
index bb5c6fc12369fe5e890246c96a32f2be8d500838..a6cbf3d843eca395742253b098d2b93846703344 100644 |
--- a/chrome/browser/metrics/chrome_metrics_services_manager_client.cc |
+++ b/chrome/browser/metrics/chrome_metrics_services_manager_client.cc |
@@ -9,6 +9,7 @@ |
#include "base/logging.h" |
#include "base/memory/ptr_util.h" |
#include "base/strings/string_number_conversions.h" |
+#include "base/task_scheduler/post_task.h" |
#include "chrome/browser/browser_process.h" |
#include "chrome/browser/metrics/chrome_metrics_service_accessor.h" |
#include "chrome/browser/metrics/chrome_metrics_service_client.h" |
@@ -62,19 +63,13 @@ const base::Feature kMetricsReportingFeature{"MetricsReporting", |
// Posts |GoogleUpdateSettings::StoreMetricsClientInfo| on blocking pool thread |
// because it needs access to IO and cannot work from UI thread. |
void PostStoreMetricsClientInfo(const metrics::ClientInfo& client_info) { |
- // The message loop processes messages after the blocking pool is initialized. |
- // Posting a task to the message loop to post a task to the blocking pool |
- // ensures that the blocking pool is ready to accept tasks at that time. |
- content::BrowserThread::PostTask( |
- content::BrowserThread::UI, FROM_HERE, |
- base::BindOnce( |
- [](const metrics::ClientInfo& client_info) { |
- content::BrowserThread::PostBlockingPoolTask( |
- FROM_HERE, |
- base::BindOnce(&GoogleUpdateSettings::StoreMetricsClientInfo, |
- client_info)); |
- }, |
- client_info)); |
+ base::PostTaskWithTraits( |
+ FROM_HERE, |
+ base::TaskTraits() |
+ .WithPriority(base::TaskPriority::BACKGROUND) |
+ .MayBlock(), |
+ base::BindOnce(&GoogleUpdateSettings::StoreMetricsClientInfo, |
+ client_info)); |
} |
// Appends a group to the sampling controlling |trial|. The group will be |