| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 MOJO_COMMON_TRACING_IMPL_H_ | 5 #ifndef MOJO_COMMON_TRACING_IMPL_H_ |
| 6 #define MOJO_COMMON_TRACING_IMPL_H_ | 6 #define MOJO_COMMON_TRACING_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "mojo/common/trace_provider_impl.h" | 9 #include "mojo/common/trace_provider_impl.h" |
| 10 #include "mojo/public/cpp/application/interface_factory.h" | |
| 11 #include "mojo/public/cpp/application/service_provider_impl.h" | 10 #include "mojo/public/cpp/application/service_provider_impl.h" |
| 12 #include "mojo/services/tracing/interfaces/tracing.mojom.h" | |
| 13 | 11 |
| 14 namespace mojo { | 12 namespace mojo { |
| 15 | 13 |
| 16 class ApplicationImpl; | 14 class ApplicationImpl; |
| 17 | 15 |
| 18 class TracingImpl : public InterfaceFactory<tracing::TraceProvider> { | 16 class TracingImpl { |
| 19 public: | 17 public: |
| 20 TracingImpl(); | 18 TracingImpl(); |
| 21 ~TracingImpl() override; | 19 ~TracingImpl(); |
| 22 | 20 |
| 23 // This connects to the tracing service and registers ourselves to provide | 21 // This connects to the tracing service and registers ourselves to provide |
| 24 // tracing data on demand. | 22 // tracing data on demand. |
| 25 void Initialize(ApplicationImpl* app); | 23 void Initialize(ApplicationImpl* app); |
| 26 | 24 |
| 27 private: | 25 private: |
| 28 // InterfaceFactory<tracing::TraceProvider> implementation. | |
| 29 void Create(ApplicationConnection* connection, | |
| 30 InterfaceRequest<tracing::TraceProvider> request) override; | |
| 31 | |
| 32 // Used to provide services *to* mojo:tracing. | |
| 33 ServiceProviderImpl outgoing_sp_for_tracing_service_; | |
| 34 | |
| 35 TraceProviderImpl provider_impl_; | 26 TraceProviderImpl provider_impl_; |
| 36 | 27 |
| 37 DISALLOW_COPY_AND_ASSIGN(TracingImpl); | 28 DISALLOW_COPY_AND_ASSIGN(TracingImpl); |
| 38 }; | 29 }; |
| 39 | 30 |
| 40 } // namespace mojo | 31 } // namespace mojo |
| 41 | 32 |
| 42 #endif // MOJO_COMMON_TRACING_IMPL_H_ | 33 #endif // MOJO_COMMON_TRACING_IMPL_H_ |
| OLD | NEW |