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