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_SERVICE_H_ | 5 #ifndef SERVICES_TRACING_SERVICE_H_ |
6 #define SERVICES_TRACING_SERVICE_H_ | 6 #define SERVICES_TRACING_SERVICE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 | 11 |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/memory/scoped_vector.h" | 13 #include "base/memory/scoped_vector.h" |
14 #include "mojo/public/cpp/bindings/binding_set.h" | 14 #include "mojo/public/cpp/bindings/binding_set.h" |
15 #include "mojo/public/cpp/bindings/interface_ptr_set.h" | 15 #include "mojo/public/cpp/bindings/interface_ptr_set.h" |
16 #include "mojo/public/cpp/bindings/strong_binding.h" | 16 #include "mojo/public/cpp/bindings/strong_binding.h" |
17 #include "services/service_manager/public/cpp/interface_factory.h" | 17 #include "services/service_manager/public/cpp/interface_factory.h" |
18 #include "services/service_manager/public/cpp/service.h" | 18 #include "services/service_manager/public/cpp/service.h" |
19 #include "services/tracing/data_sink.h" | 19 #include "services/tracing/data_sink.h" |
20 #include "services/tracing/public/interfaces/tracing.mojom.h" | 20 #include "services/tracing/public/interfaces/tracing.mojom.h" |
21 #include "services/tracing/recorder.h" | 21 #include "services/tracing/recorder.h" |
22 | 22 |
23 namespace tracing { | 23 namespace tracing { |
24 | 24 |
25 class Service | 25 class Service : public service_manager::Service, |
26 : public shell::Service, | 26 public service_manager::InterfaceFactory<mojom::Factory>, |
27 public shell::InterfaceFactory<mojom::Factory>, | 27 public service_manager::InterfaceFactory<mojom::Collector>, |
28 public shell::InterfaceFactory<mojom::Collector>, | 28 public service_manager::InterfaceFactory< |
29 public shell::InterfaceFactory<mojom::StartupPerformanceDataCollector>, | 29 mojom::StartupPerformanceDataCollector>, |
30 public mojom::Factory, | 30 public mojom::Factory, |
31 public mojom::Collector, | 31 public mojom::Collector, |
32 public mojom::StartupPerformanceDataCollector { | 32 public mojom::StartupPerformanceDataCollector { |
33 public: | 33 public: |
34 Service(); | 34 Service(); |
35 ~Service() override; | 35 ~Service() override; |
36 | 36 |
37 private: | 37 private: |
38 // shell::Service implementation. | 38 // service_manager::Service implementation. |
39 bool OnConnect(const shell::Identity& remote_identity, | 39 bool OnConnect(const service_manager::Identity& remote_identity, |
40 shell::InterfaceRegistry* registry) override; | 40 service_manager::InterfaceRegistry* registry) override; |
41 bool OnStop() override; | 41 bool OnStop() override; |
42 | 42 |
43 // shell::InterfaceFactory<mojom::Factory>: | 43 // service_manager::InterfaceFactory<mojom::Factory>: |
44 void Create(const shell::Identity& remote_identity, | 44 void Create(const service_manager::Identity& remote_identity, |
45 mojom::FactoryRequest request) override; | 45 mojom::FactoryRequest request) override; |
46 | 46 |
47 // shell::InterfaceFactory<mojom::Collector>: | 47 // service_manager::InterfaceFactory<mojom::Collector>: |
48 void Create(const shell::Identity& remote_identity, | 48 void Create(const service_manager::Identity& remote_identity, |
49 mojom::CollectorRequest request) override; | 49 mojom::CollectorRequest request) override; |
50 | 50 |
51 // shell::InterfaceFactory<mojom::StartupPerformanceDataCollector>: | 51 // service_manager::InterfaceFactory<mojom::StartupPerformanceDataCollector>: |
52 void Create( | 52 void Create(const service_manager::Identity& remote_identity, |
53 const shell::Identity& remote_identity, | 53 mojom::StartupPerformanceDataCollectorRequest request) override; |
54 mojom::StartupPerformanceDataCollectorRequest request) override; | |
55 | 54 |
56 // mojom::Factory: | 55 // mojom::Factory: |
57 void CreateRecorder(mojom::ProviderPtr provider) override; | 56 void CreateRecorder(mojom::ProviderPtr provider) override; |
58 | 57 |
59 // mojom::Collector: | 58 // mojom::Collector: |
60 void Start(mojo::ScopedDataPipeProducerHandle stream, | 59 void Start(mojo::ScopedDataPipeProducerHandle stream, |
61 const std::string& categories) override; | 60 const std::string& categories) override; |
62 void StopAndFlush() override; | 61 void StopAndFlush() override; |
63 | 62 |
64 // mojom::StartupPerformanceDataCollector: | 63 // mojom::StartupPerformanceDataCollector: |
(...skipping 19 matching lines...) Expand all Loading... |
84 mojom::StartupPerformanceTimes startup_performance_times_; | 83 mojom::StartupPerformanceTimes startup_performance_times_; |
85 bool tracing_active_; | 84 bool tracing_active_; |
86 mojo::String tracing_categories_; | 85 mojo::String tracing_categories_; |
87 | 86 |
88 DISALLOW_COPY_AND_ASSIGN(Service); | 87 DISALLOW_COPY_AND_ASSIGN(Service); |
89 }; | 88 }; |
90 | 89 |
91 } // namespace tracing | 90 } // namespace tracing |
92 | 91 |
93 #endif // SERVICES_TRACING_SERVICE_H_ | 92 #endif // SERVICES_TRACING_SERVICE_H_ |
OLD | NEW |