Fork the mojo shell interfaces used by Mandoline.
[chromium-blink-merge.git] / mojo / services / tracing / tracing_app.h
blobf652c29c96181e5e5b75a20e12f401a30d16f180
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef MOJO_SERVICES_TRACING_TRACING_APP_H_
6 #define MOJO_SERVICES_TRACING_TRACING_APP_H_
8 #include "base/memory/scoped_vector.h"
9 #include "mojo/application/public/cpp/application_delegate.h"
10 #include "mojo/application/public/cpp/interface_factory.h"
11 #include "mojo/common/weak_binding_set.h"
12 #include "mojo/common/weak_interface_ptr_set.h"
13 #include "mojo/public/cpp/bindings/strong_binding.h"
14 #include "mojo/services/tracing/tracing.mojom.h"
16 namespace tracing {
18 class CollectorImpl;
19 class TraceDataSink;
21 class TracingApp : public mojo::ApplicationDelegate,
22 public mojo::InterfaceFactory<TraceCoordinator>,
23 public TraceCoordinator {
24 public:
25 TracingApp();
26 ~TracingApp() override;
28 private:
29 // mojo::ApplicationDelegate implementation.
30 bool ConfigureIncomingConnection(
31 mojo::ApplicationConnection* connection) override;
33 // mojo::InterfaceFactory<TraceCoordinator> implementation.
34 void Create(mojo::ApplicationConnection* connection,
35 mojo::InterfaceRequest<TraceCoordinator> request) override;
37 // tracing::TraceCoordinator implementation.
38 void Start(mojo::ScopedDataPipeProducerHandle stream,
39 const mojo::String& categories) override;
40 void StopAndFlush() override;
42 void AllDataCollected();
44 scoped_ptr<TraceDataSink> sink_;
45 ScopedVector<CollectorImpl> collector_impls_;
46 mojo::WeakInterfacePtrSet<TraceController> controller_ptrs_;
47 mojo::WeakBindingSet<TraceCoordinator> coordinator_bindings_;
49 DISALLOW_COPY_AND_ASSIGN(TracingApp);
52 } // namespace tracing
54 #endif // MOJO_SERVICES_TRACING_TRACING_APP_H_