blob: 48847cb9db709ffbf86d1b3d4de6c6003c2245b3 [file] [log] [blame]
Ahmed Nasr8d2c5df52022-11-11 23:05:081// 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 Sonzognic571efb2024-01-26 20:26:188#include <optional>
9
Ahmed Nasr8d2c5df52022-11-11 23:05:0810#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 Nasr8d2c5df52022-11-11 23:05:0814
15namespace reporting {
16
17class Sampler;
18
19// A base class for metric data collection.
20class 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 Nasr8d2c5df52022-11-11 23:05:0829 // Collect metric data provided by `sampler_` asynchronously.
Ahmed Nasr