| 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 "components/policy/core/common/policy_statistics_collector.h" | 5 #include "components/policy/core/common/policy_statistics_collector.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/location.h" | 12 #include "base/location.h" |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/metrics/sparse_histogram.h" | 14 #include "base/metrics/histogram_macros.h" |
| 15 #include "base/task_runner.h" | 15 #include "base/task_runner.h" |
| 16 #include "components/policy/core/common/policy_pref_names.h" | 16 #include "components/policy/core/common/policy_pref_names.h" |
| 17 #include "components/policy/core/common/policy_service.h" | 17 #include "components/policy/core/common/policy_service.h" |
| 18 #include "components/prefs/pref_registry_simple.h" | 18 #include "components/prefs/pref_registry_simple.h" |
| 19 #include "components/prefs/pref_service.h" | 19 #include "components/prefs/pref_service.h" |
| 20 | 20 |
| 21 namespace policy { | 21 namespace policy { |
| 22 | 22 |
| 23 const int PolicyStatisticsCollector::kStatisticsUpdateRate = | 23 const int PolicyStatisticsCollector::kStatisticsUpdateRate = |
| 24 24 * 60 * 60 * 1000; // 24 hours. | 24 24 * 60 * 60 * 1000; // 24 hours. |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 } | 85 } |
| 86 | 86 |
| 87 void PolicyStatisticsCollector::ScheduleUpdate(base::TimeDelta delay) { | 87 void PolicyStatisticsCollector::ScheduleUpdate(base::TimeDelta delay) { |
| 88 update_callback_.Reset(base::Bind( | 88 update_callback_.Reset(base::Bind( |
| 89 &PolicyStatisticsCollector::CollectStatistics, | 89 &PolicyStatisticsCollector::CollectStatistics, |
| 90 base::Unretained(this))); | 90 base::Unretained(this))); |
| 91 task_runner_->PostDelayedTask(FROM_HERE, update_callback_.callback(), delay); | 91 task_runner_->PostDelayedTask(FROM_HERE, update_callback_.callback(), delay); |
| 92 } | 92 } |
| 93 | 93 |
| 94 } // namespace policy | 94 } // namespace policy |
| OLD | NEW |