Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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. | |
| 4 | |
| 5 #ifndef SERVICES_TRACING_TRACING_APP_H_ | |
| 6 #define SERVICES_TRACING_TRACING_APP_H_ | |
| 7 | |
| 8 #include "base/memory/scoped_vector.h" | |
|
viettrungluu
2015/04/02 19:54:13
nit: include "base/macros.h"
probably also base/me
| |
| 9 #include "mojo/common/weak_binding_set.h" | |
| 10 #include "mojo/common/weak_interface_ptr_set.h" | |
| 11 #include "mojo/public/cpp/application/application_delegate.h" | |
| 12 #include "mojo/public/cpp/application/application_impl.h" | |
| 13 #include "mojo/public/cpp/bindings/strong_binding.h" | |
| 14 #include "services/tracing/collector_impl.h" | |
| 15 #include "services/tracing/trace_data_sink.h" | |
| 16 #include "services/tracing/tracing.mojom.h" | |
| 17 | |
| 18 namespace tracing { | |
| 19 | |
| 20 class TracingApp : public mojo::ApplicationDelegate, | |
| 21 public mojo::InterfaceFactory<TraceCoordinator>, | |
| 22 public TraceCoordinator { | |
| 23 public: | |
| 24 TracingApp(); | |
| 25 ~TracingApp() override; | |
| 26 | |
| 27 private: | |
| 28 // mojo::ApplicationDelegate implementation. | |
| 29 bool ConfigureIncomingConnection( | |
| 30 mojo::ApplicationConnection* connection) override; | |
| 31 | |
| 32 // mojo::InterfaceFactory<TraceCoordinator> implementation. | |
| 33 void Create(mojo::ApplicationConnection* connection, | |
| 34 mojo::InterfaceRequest<TraceCoordinator> request) override; | |
| 35 | |
| 36 // tracing::TraceCoordinator implementation. | |
| 37 void Start(mojo::ScopedDataPipeProducerHandle stream, | |
| 38 const mojo::String& categories) override; | |
| 39 void StopAndFlush() override; | |
| 40 | |
| 41 void AllDataCollected(); | |
| 42 | |
| 43 scoped_ptr<TraceDataSink> sink_; | |
| 44 ScopedVector<CollectorImpl> collector_impls_; | |
| 45 mojo::WeakInterfacePtrSet<TraceController> controller_ptrs_; | |
| 46 mojo::Binding<TraceCoordinator> coordinator_binding_; | |
| 47 bool tracing_active_; | |
| 48 mojo::String tracing_categories_; | |
| 49 | |
| 50 DISALLOW_COPY_AND_ASSIGN(TracingApp); | |
| 51 }; | |
| 52 | |
| 53 } // namespace tracing | |
| 54 | |
| 55 #endif // SERVICES_TRACING_TRACING_APP_H_ | |
| OLD | NEW |