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 MOJO_SERVICES_TRACING_TRACING_APP_H_ | 5 #ifndef MOJO_SERVICES_TRACING_TRACING_APP_H_ |
6 #define MOJO_SERVICES_TRACING_TRACING_APP_H_ | 6 #define MOJO_SERVICES_TRACING_TRACING_APP_H_ |
7 | 7 |
8 #include "base/memory/scoped_vector.h" | 8 #include "base/memory/scoped_vector.h" |
9 #include "mojo/application/public/cpp/application_delegate.h" | 9 #include "mojo/application/public/cpp/application_delegate.h" |
10 #include "mojo/application/public/cpp/interface_factory.h" | 10 #include "mojo/application/public/cpp/interface_factory.h" |
11 #include "mojo/common/weak_binding_set.h" | 11 #include "mojo/common/weak_binding_set.h" |
12 #include "mojo/common/weak_interface_ptr_set.h" | 12 #include "mojo/common/weak_interface_ptr_set.h" |
13 #include "mojo/public/cpp/bindings/strong_binding.h" | 13 #include "mojo/public/cpp/bindings/strong_binding.h" |
14 #include "mojo/services/tracing/tracing.mojom.h" | 14 #include "mojo/services/tracing/public/interfaces/tracing.mojom.h" |
15 | 15 |
16 namespace tracing { | 16 namespace tracing { |
17 | 17 |
18 class CollectorImpl; | 18 class CollectorImpl; |
19 class TraceDataSink; | 19 class TraceDataSink; |
20 | 20 |
21 class TracingApp : public mojo::ApplicationDelegate, | 21 class TracingApp |
22 public mojo::InterfaceFactory<TraceCoordinator>, | 22 : public mojo::ApplicationDelegate, |
23 public TraceCoordinator { | 23 public mojo::InterfaceFactory<TraceCoordinator>, |
| 24 public TraceCoordinator, |
| 25 public mojo::InterfaceFactory<StartupPerformanceDataCollector>, |
| 26 public StartupPerformanceDataCollector { |
24 public: | 27 public: |
25 TracingApp(); | 28 TracingApp(); |
26 ~TracingApp() override; | 29 ~TracingApp() override; |
27 | 30 |
28 private: | 31 private: |
29 // mojo::ApplicationDelegate implementation. | 32 // mojo::ApplicationDelegate implementation. |
30 bool ConfigureIncomingConnection( | 33 bool ConfigureIncomingConnection( |
31 mojo::ApplicationConnection* connection) override; | 34 mojo::ApplicationConnection* connection) override; |
32 | 35 |
33 // mojo::InterfaceFactory<TraceCoordinator> implementation. | 36 // mojo::InterfaceFactory<TraceCoordinator> implementation. |
34 void Create(mojo::ApplicationConnection* connection, | 37 void Create(mojo::ApplicationConnection* connection, |
35 mojo::InterfaceRequest<TraceCoordinator> request) override; | 38 mojo::InterfaceRequest<TraceCoordinator> request) override; |
36 | 39 |
37 // tracing::TraceCoordinator implementation. | 40 // mojo::InterfaceFactory<StartupPerformanceDataCollector> implementation. |
| 41 void Create( |
| 42 mojo::ApplicationConnection* connection, |
| 43 mojo::InterfaceRequest<StartupPerformanceDataCollector> request) override; |
| 44 |
| 45 // TraceCoordinator implementation. |
38 void Start(mojo::ScopedDataPipeProducerHandle stream, | 46 void Start(mojo::ScopedDataPipeProducerHandle stream, |
39 const mojo::String& categories) override; | 47 const mojo::String& categories) override; |
40 void StopAndFlush() override; | 48 void StopAndFlush() override; |
41 | 49 |
| 50 // StartupPerformanceDataCollector implementation. |
| 51 void SetShellProcessCreationTime(int64 time) override; |
| 52 void SetBrowserMessageLoopStartTime(int64 time) override; |
| 53 void SetBrowserWindowDisplayTime(int64 time) override; |
| 54 void SetBrowserOpenTabsTime(int64 time) override; |
| 55 void SetFirstWebContentsMainFrameLoadTime(int64 time) override; |
| 56 void SetFirstVisuallyNonEmptyLayoutTime(int64 time) override; |
| 57 void GetStartupPerformanceTimes( |
| 58 const GetStartupPerformanceTimesCallback& callback) override; |
| 59 |
42 void AllDataCollected(); | 60 void AllDataCollected(); |
43 | 61 |
44 scoped_ptr<TraceDataSink> sink_; | 62 scoped_ptr<TraceDataSink> sink_; |
45 ScopedVector<CollectorImpl> collector_impls_; | 63 ScopedVector<CollectorImpl> collector_impls_; |
46 mojo::WeakInterfacePtrSet<TraceController> controller_ptrs_; | 64 mojo::WeakInterfacePtrSet<TraceController> controller_ptrs_; |
47 mojo::WeakBindingSet<TraceCoordinator> coordinator_bindings_; | 65 mojo::WeakBindingSet<TraceCoordinator> coordinator_bindings_; |
| 66 mojo::WeakBindingSet<StartupPerformanceDataCollector> |
| 67 startup_performance_data_collector_bindings_; |
| 68 StartupPerformanceTimes startup_performance_times_; |
48 | 69 |
49 DISALLOW_COPY_AND_ASSIGN(TracingApp); | 70 DISALLOW_COPY_AND_ASSIGN(TracingApp); |
50 }; | 71 }; |
51 | 72 |
52 } // namespace tracing | 73 } // namespace tracing |
53 | 74 |
54 #endif // MOJO_SERVICES_TRACING_TRACING_APP_H_ | 75 #endif // MOJO_SERVICES_TRACING_TRACING_APP_H_ |
OLD | NEW |