Commit 147e4952 authored by fdoray's avatar fdoray Committed by Commit bot

Use TaskScheduler instead of blocking pool in chrome_metrics_services_manager_client.cc.

The blocking pool is being deprecated in favor of TaskScheduler.

BUG=667892
R=rkaplow@chromium.org

Review-Url: https://codereview.chromium.org/2769803002
Cr-Commit-Position: refs/heads/master@{#467681}
parent 1982eef8
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment