summaryrefslogtreecommitdiff
path: root/chromium/services/tracing/tracing_service.h
blob: 0b29b2d6499c880bb3268ffbdf4ce5aeaf776f96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef SERVICES_TRACING_TRACING_SERVICE_H_
#define SERVICES_TRACING_TRACING_SERVICE_H_

#include "build/build_config.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "services/tracing/public/mojom/tracing_service.mojom.h"

namespace tracing {

class TracingService : public mojom::TracingService {
 public:
  TracingService();
  explicit TracingService(
      mojo::PendingReceiver<mojom::TracingService> receiver);
  TracingService(const TracingService&) = delete;
  ~TracingService() override;
  TracingService& operator=(const TracingService&) = delete;

  // mojom::TracingService implementation:
  void Initialize(std::vector<mojom::ClientInfoPtr> clients) override;
  void AddClient(mojom::ClientInfoPtr client) override;
#if !defined(OS_NACL) && !defined(OS_IOS)
  void BindConsumerHost(
      mojo::PendingReceiver<mojom::ConsumerHost> receiver) override;
#endif

 private:
  mojo::Receiver<mojom::TracingService> receiver_{this};
};

}  // namespace tracing

#endif  // SERVICES_TRACING_TRACING_SERVICE_H_