Chromium Code Reviews| 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 82a5a10ac877320c1b619cf3acae581465813315..628d8ce881270f4263a65781184b0dd60d171275 100644 |
| --- a/chrome/browser/metrics/chrome_metrics_services_manager_client.cc |
| +++ b/chrome/browser/metrics/chrome_metrics_services_manager_client.cc |
| @@ -59,9 +59,18 @@ 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) { |
| - content::BrowserThread::GetBlockingPool()->PostTask( |
| - FROM_HERE, |
| - base::Bind(&GoogleUpdateSettings::StoreMetricsClientInfo, client_info)); |
| + // The delayed post task allows this function to get called before the |
| + // blocking pool is ready to go. |
|
gab
2016/12/13 15:58:39
(this sentence is backwards?)
// Posting the task
robliao
2016/12/13 18:19:38
Clarified to
// The message loop processes message
|
| + content::BrowserThread::PostTask( |
| + content::BrowserThread::UI, FROM_HERE, |
| + base::Bind( |
| + [](const metrics::ClientInfo& client_info) { |
| + content::BrowserThread::PostBlockingPoolTask( |
| + FROM_HERE, |
| + base::Bind(&GoogleUpdateSettings::StoreMetricsClientInfo, |
| + client_info)); |
| + }, |
| + client_info)); |
| } |
| // Appends a group to the sampling controlling |trial|. The group will be |