| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef SERVICES_TRACING_TRACING_APP_H_ | 5 #ifndef SERVICES_TRACING_TRACING_APP_H_ |
| 6 #define SERVICES_TRACING_TRACING_APP_H_ | 6 #define SERVICES_TRACING_TRACING_APP_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
| 11 #include "mojo/common/interface_ptr_set.h" | 11 #include "mojo/common/interface_ptr_set.h" |
| 12 #include "mojo/public/cpp/application/application_delegate.h" | 12 #include "mojo/public/cpp/application/application_delegate.h" |
| 13 #include "mojo/public/cpp/application/application_impl.h" | 13 #include "mojo/public/cpp/application/application_impl.h" |
| 14 #include "mojo/public/cpp/bindings/strong_binding.h" | 14 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 15 #include "mojo/services/tracing/public/interfaces/tracing.mojom.h" | 15 #include "mojo/services/tracing/public/interfaces/tracing.mojom.h" |
| 16 #include "services/tracing/collector_impl.h" | |
| 17 #include "services/tracing/trace_data_sink.h" | 16 #include "services/tracing/trace_data_sink.h" |
| 17 #include "services/tracing/trace_recorder_impl.h" |
| 18 | 18 |
| 19 namespace tracing { | 19 namespace tracing { |
| 20 | 20 |
| 21 class TracingApp : public mojo::ApplicationDelegate, | 21 class TracingApp : public mojo::ApplicationDelegate, |
| 22 public mojo::InterfaceFactory<TraceCoordinator>, | 22 public mojo::InterfaceFactory<TraceCollector>, |
| 23 public TraceCoordinator { | 23 public TraceCollector { |
| 24 public: | 24 public: |
| 25 TracingApp(); | 25 TracingApp(); |
| 26 ~TracingApp() override; | 26 ~TracingApp() override; |
| 27 | 27 |
| 28 private: | 28 private: |
| 29 // mojo::ApplicationDelegate implementation. | 29 // mojo::ApplicationDelegate implementation. |
| 30 bool ConfigureIncomingConnection( | 30 bool ConfigureIncomingConnection( |
| 31 mojo::ApplicationConnection* connection) override; | 31 mojo::ApplicationConnection* connection) override; |
| 32 | 32 |
| 33 // mojo::InterfaceFactory<TraceCoordinator> implementation. | 33 // mojo::InterfaceFactory<TraceCollector> implementation. |
| 34 void Create(mojo::ApplicationConnection* connection, | 34 void Create(mojo::ApplicationConnection* connection, |
| 35 mojo::InterfaceRequest<TraceCoordinator> request) override; | 35 mojo::InterfaceRequest<TraceCollector> request) override; |
| 36 | 36 |
| 37 // tracing::TraceCoordinator implementation. | 37 // tracing::TraceCollector implementation. |
| 38 void Start(mojo::ScopedDataPipeProducerHandle stream, | 38 void Start(mojo::ScopedDataPipeProducerHandle stream, |
| 39 const mojo::String& categories) override; | 39 const mojo::String& categories) override; |
| 40 void StopAndFlush() override; | 40 void StopAndFlush() override; |
| 41 | 41 |
| 42 void AllDataCollected(); | 42 void AllDataCollected(); |
| 43 | 43 |
| 44 scoped_ptr<TraceDataSink> sink_; | 44 scoped_ptr<TraceDataSink> sink_; |
| 45 ScopedVector<CollectorImpl> collector_impls_; | 45 ScopedVector<TraceRecorderImpl> recorder_impls_; |
| 46 mojo::InterfacePtrSet<TraceController> controller_ptrs_; | 46 mojo::InterfacePtrSet<TraceProvider> provider_ptrs_; |
| 47 mojo::Binding<TraceCoordinator> coordinator_binding_; | 47 mojo::Binding<TraceCollector> collector_binding_; |
| 48 bool tracing_active_; | 48 bool tracing_active_; |
| 49 mojo::String tracing_categories_; | 49 mojo::String tracing_categories_; |
| 50 | 50 |
| 51 DISALLOW_COPY_AND_ASSIGN(TracingApp); | 51 DISALLOW_COPY_AND_ASSIGN(TracingApp); |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 } // namespace tracing | 54 } // namespace tracing |
| 55 | 55 |
| 56 #endif // SERVICES_TRACING_TRACING_APP_H_ | 56 #endif // SERVICES_TRACING_TRACING_APP_H_ |
| OLD | NEW |