| 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/binding_set.h" | 11 #include "mojo/common/binding_set.h" |
| 12 #include "mojo/common/interface_ptr_set.h" | 12 #include "mojo/common/interface_ptr_set.h" |
| 13 #include "mojo/public/cpp/application/application_delegate.h" | 13 #include "mojo/public/cpp/application/application_impl_base.h" |
| 14 #include "mojo/public/cpp/application/application_impl.h" | |
| 15 #include "mojo/public/cpp/bindings/strong_binding.h" | 14 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 16 #include "mojo/services/tracing/interfaces/trace_provider_registry.mojom.h" | 15 #include "mojo/services/tracing/interfaces/trace_provider_registry.mojom.h" |
| 17 #include "mojo/services/tracing/interfaces/tracing.mojom.h" | 16 #include "mojo/services/tracing/interfaces/tracing.mojom.h" |
| 18 #include "services/tracing/trace_data_sink.h" | 17 #include "services/tracing/trace_data_sink.h" |
| 19 #include "services/tracing/trace_recorder_impl.h" | 18 #include "services/tracing/trace_recorder_impl.h" |
| 20 | 19 |
| 21 namespace tracing { | 20 namespace tracing { |
| 22 | 21 |
| 23 class TracingApp : public mojo::ApplicationDelegate, | 22 class TracingApp : public mojo::ApplicationImplBase, |
| 24 public TraceCollector, | 23 public TraceCollector, |
| 25 public TraceProviderRegistry { | 24 public TraceProviderRegistry { |
| 26 public: | 25 public: |
| 27 TracingApp(); | 26 TracingApp(); |
| 28 ~TracingApp() override; | 27 ~TracingApp() override; |
| 29 | 28 |
| 30 private: | 29 private: |
| 31 // mojo::ApplicationDelegate implementation. | 30 // mojo::ApplicationImplBase override. |
| 32 bool ConfigureIncomingConnection( | 31 bool OnAcceptConnection( |
| 33 mojo::ServiceProviderImpl* service_provider_impl) override; | 32 mojo::ServiceProviderImpl* service_provider_impl) override; |
| 34 | 33 |
| 35 // TraceCollector implementation. | 34 // TraceCollector implementation. |
| 36 void Start(mojo::ScopedDataPipeProducerHandle stream, | 35 void Start(mojo::ScopedDataPipeProducerHandle stream, |
| 37 const mojo::String& categories) override; | 36 const mojo::String& categories) override; |
| 38 void StopAndFlush() override; | 37 void StopAndFlush() override; |
| 39 | 38 |
| 40 // TraceProviderRegistry implementation. | 39 // TraceProviderRegistry implementation. |
| 41 void RegisterTraceProvider( | 40 void RegisterTraceProvider( |
| 42 mojo::InterfaceHandle<TraceProvider> trace_provider) override; | 41 mojo::InterfaceHandle<TraceProvider> trace_provider) override; |
| 43 | 42 |
| 44 void AllDataCollected(); | 43 void AllDataCollected(); |
| 45 | 44 |
| 46 scoped_ptr<TraceDataSink> sink_; | 45 scoped_ptr<TraceDataSink> sink_; |
| 47 ScopedVector<TraceRecorderImpl> recorder_impls_; | 46 ScopedVector<TraceRecorderImpl> recorder_impls_; |
| 48 mojo::InterfacePtrSet<TraceProvider> provider_ptrs_; | 47 mojo::InterfacePtrSet<TraceProvider> provider_ptrs_; |
| 49 mojo::Binding<TraceCollector> collector_binding_; | 48 mojo::Binding<TraceCollector> collector_binding_; |
| 50 mojo::BindingSet<TraceProviderRegistry> provider_registry_bindings_; | 49 mojo::BindingSet<TraceProviderRegistry> provider_registry_bindings_; |
| 51 bool tracing_active_; | 50 bool tracing_active_; |
| 52 mojo::String tracing_categories_; | 51 mojo::String tracing_categories_; |
| 53 | 52 |
| 54 DISALLOW_COPY_AND_ASSIGN(TracingApp); | 53 DISALLOW_COPY_AND_ASSIGN(TracingApp); |
| 55 }; | 54 }; |
| 56 | 55 |
| 57 } // namespace tracing | 56 } // namespace tracing |
| 58 | 57 |
| 59 #endif // SERVICES_TRACING_TRACING_APP_H_ | 58 #endif // SERVICES_TRACING_TRACING_APP_H_ |
| OLD | NEW |