summaryrefslogtreecommitdiffstats
path: root/mojo/services/tracing/public/cpp/tracing_impl.h
blob: 648023f887c2b05209c890d8e989b9bfd2f92e38 (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
39
40
// Copyright 2014 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 MOJO_SERVICES_TRACING_PUBLIC_CPP_TRACING_IMPL_H_
#define MOJO_SERVICES_TRACING_PUBLIC_CPP_TRACING_IMPL_H_

#include "base/macros.h"
#include "mojo/application/public/cpp/interface_factory.h"
#include "mojo/services/tracing/public/cpp/trace_provider_impl.h"
#include "mojo/services/tracing/public/interfaces/tracing.mojom.h"

namespace mojo {

class ApplicationConnection;
class ApplicationImpl;

class TracingImpl : public InterfaceFactory<tracing::TraceProvider> {
 public:
  TracingImpl();
  ~TracingImpl() override;

  // This connects to the tracing service and registers ourselves to provide
  // tracing data on demand.
  void Initialize(ApplicationImpl* app);

 private:
  // InterfaceFactory<tracing::TraceProvider> implementation.
  void Create(ApplicationConnection* connection,
              InterfaceRequest<tracing::TraceProvider> request) override;

  scoped_ptr<ApplicationConnection> connection_;
  TraceProviderImpl provider_impl_;

  DISALLOW_COPY_AND_ASSIGN(TracingImpl);
};

}  // namespace mojo

#endif  // MOJO_SERVICES_TRACING_PUBLIC_CPP_TRACING_IMPL_H_