Ahmed Nasr | 8d2c5df5 | 2022-11-11 23:05:08 | [diff] [blame] | 1 | // Copyright 2022 The Chromium Authors |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef COMPONENTS_REPORTING_METRICS_COLLECTOR_BASE_H_ |
| 6 | #define COMPONENTS_REPORTING_METRICS_COLLECTOR_BASE_H_ |
| 7 | |
Arthur Sonzogni | c571efb | 2024-01-26 20:26:18 | [diff] [blame^] | 8 | #include <optional> |
| 9 | |
Ahmed Nasr | 8d2c5df5 | 2022-11-11 23:05:08 | [diff] [blame] | 10 | #include "base/memory/raw_ptr.h" |
| 11 | #include "base/memory/weak_ptr.h" |
| 12 | #include "base/sequence_checker.h" |
| 13 | #include "components/reporting/proto/synced/metric_data.pb.h" |
Ahmed Nasr | 8d2c5df5 | 2022-11-11 23:05:08 | [diff] [blame] | 14 | |
| 15 | namespace reporting { |
| 16 | |
| 17 | class Sampler; |
| 18 | |
| 19 | // A base class for metric data collection. |
| 20 | class CollectorBase { |
| 21 | public: |
| 22 | explicit CollectorBase(Sampler* sampler); |
| 23 | |
| 24 | CollectorBase(const CollectorBase& other) = delete; |
| 25 | CollectorBase& operator=(const CollectorBase& other) = delete; |
| 26 | |
| 27 | virtual ~CollectorBase(); |
| 28 | |
Ahmed Nasr | 8d2c5df5 | 2022-11-11 23:05:08 | [diff] [blame] | 29 | // Collect metric data provided by `sampler_` asynchronously. |
Ahmed Nasr |
|