OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/chromeos/external_metrics.h" | 5 #include "chrome/browser/chromeos/external_metrics.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <memory> | 10 #include <memory> |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 return samples.size(); | 166 return samples.size(); |
167 } | 167 } |
168 | 168 |
169 void ExternalMetrics::CollectEventsAndReschedule() { | 169 void ExternalMetrics::CollectEventsAndReschedule() { |
170 CollectEvents(); | 170 CollectEvents(); |
171 ScheduleCollector(); | 171 ScheduleCollector(); |
172 } | 172 } |
173 | 173 |
174 void ExternalMetrics::ScheduleCollector() { | 174 void ExternalMetrics::ScheduleCollector() { |
175 base::PostDelayedTaskWithTraits( | 175 base::PostDelayedTaskWithTraits( |
176 FROM_HERE, | 176 FROM_HERE, {base::MayBlock(), base::TaskPriority::BACKGROUND}, |
177 base::TaskTraits().MayBlock().WithPriority( | |
178 base::TaskPriority::BACKGROUND), | |
179 base::BindOnce(&chromeos::ExternalMetrics::CollectEventsAndReschedule, | 177 base::BindOnce(&chromeos::ExternalMetrics::CollectEventsAndReschedule, |
180 this), | 178 this), |
181 kExternalMetricsCollectionInterval); | 179 kExternalMetricsCollectionInterval); |
182 } | 180 } |
183 | 181 |
184 } // namespace chromeos | 182 } // namespace chromeos |
OLD | NEW |