| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef COMPONENTS_METRICS_FILE_METRICS_PROVIDER_H_ | 5 #ifndef COMPONENTS_METRICS_FILE_METRICS_PROVIDER_H_ |
| 6 #define COMPONENTS_METRICS_FILE_METRICS_PROVIDER_H_ | 6 #define COMPONENTS_METRICS_FILE_METRICS_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "base/callback.h" | 12 #include "base/callback.h" |
| 13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
| 14 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
| 15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 16 #include "base/threading/thread_checker.h" | 16 #include "base/threading/thread_checker.h" |
| 17 #include "base/time/time.h" | 17 #include "base/time/time.h" |
| 18 #include "components/metrics/metrics_provider.h" | 18 #include "components/metrics/metrics_provider.h" |
| 19 | 19 |
| 20 class PrefRegistrySimple; | 20 class PrefRegistrySimple; |
| 21 class PrefService; | 21 class PrefService; |
| 22 | 22 |
| 23 namespace base { | 23 namespace base { |
| 24 class MemoryMappedFile; | |
| 25 class PersistentMemoryAllocator; | |
| 26 class TaskRunner; | 24 class TaskRunner; |
| 27 } | 25 } |
| 28 | 26 |
| 29 namespace metrics { | 27 namespace metrics { |
| 30 | 28 |
| 31 // FileMetricsProvider gathers and logs histograms written to files on disk. | 29 // FileMetricsProvider gathers and logs histograms written to files on disk. |
| 32 // Any number of files can be registered and will be polled once per upload | 30 // Any number of files can be registered and will be polled once per upload |
| 33 // cycle (at startup and periodically thereafter -- about every 30 minutes | 31 // cycle (at startup and periodically thereafter -- about every 30 minutes |
| 34 // for desktop) for data to send. | 32 // for desktop) for data to send. |
| 35 class FileMetricsProvider : public MetricsProvider { | 33 class FileMetricsProvider : public MetricsProvider { |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 | 195 |
| 198 base::ThreadChecker thread_checker_; | 196 base::ThreadChecker thread_checker_; |
| 199 base::WeakPtrFactory<FileMetricsProvider> weak_factory_; | 197 base::WeakPtrFactory<FileMetricsProvider> weak_factory_; |
| 200 | 198 |
| 201 DISALLOW_COPY_AND_ASSIGN(FileMetricsProvider); | 199 DISALLOW_COPY_AND_ASSIGN(FileMetricsProvider); |
| 202 }; | 200 }; |
| 203 | 201 |
| 204 } // namespace metrics | 202 } // namespace metrics |
| 205 | 203 |
| 206 #endif // COMPONENTS_METRICS_FILE_METRICS_PROVIDER_H_ | 204 #endif // COMPONENTS_METRICS_FILE_METRICS_PROVIDER_H_ |
| OLD | NEW |