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/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 : public mojo::ApplicationDelegate, |
22 public mojo::InterfaceFactory<TraceCoordinator>, | 22 public mojo::InterfaceFactory<TraceCoordinator>, |
23 public TraceCoordinator { | 23 public TraceCoordinator, |
| 24 public mojo::InterfaceFactory<StartupPerformanceController>, |
| 25 public StartupPerformanceController { |
24 public: | 26 public: |
25 TracingApp(); | 27 TracingApp(); |
26 ~TracingApp() override; | 28 ~TracingApp() override; |
27 | 29 |
28 private: | 30 private: |
29 // mojo::ApplicationDelegate implementation. | 31 // mojo::ApplicationDelegate implementation. |
30 bool ConfigureIncomingConnection( | 32 bool ConfigureIncomingConnection( |
31 mojo::ApplicationConnection* connection) override; | 33 mojo::ApplicationConnection* connection) override; |
32 | 34 |
33 // mojo::InterfaceFactory<TraceCoordinator> implementation. | 35 // mojo::InterfaceFactory<TraceCoordinator> implementation. |
34 void Create(mojo::ApplicationConnection* connection, | 36 void Create(mojo::ApplicationConnection* connection, |
35 mojo::InterfaceRequest<TraceCoordinator> request) override; | 37 mojo::InterfaceRequest<TraceCoordinator> request) override; |
36 | 38 |
| 39 // mojo::InterfaceFactory<StartupPerformanceController> implementation. |
| 40 void Create( |
| 41 mojo::ApplicationConnection* connection, |
| 42 mojo::InterfaceRequest<StartupPerformanceController> request) override; |
| 43 |
37 // tracing::TraceCoordinator implementation. | 44 // tracing::TraceCoordinator implementation. |
38 void Start(mojo::ScopedDataPipeProducerHandle stream, | 45 void Start(mojo::ScopedDataPipeProducerHandle stream, |
39 const mojo::String& categories) override; | 46 const mojo::String& categories) override; |
40 void StopAndFlush() override; | 47 void StopAndFlush() override; |
41 | 48 |
| 49 // tracing::StartupPerformanceController implementation. |
| 50 void SetShellProcessCreationTime(int64 time) override; |
| 51 void SetBrowserMessageLoopStartTime(int64 time) override; |
| 52 void SetBrowserWindowDisplayTime(int64 time) override; |
| 53 void SetBrowserOpenTabsTime(int64 time) override; |
| 54 void SetFirstWebContentsMainFrameLoadTime(int64 time) override; |
| 55 void SetFirstVisuallyNonEmptyLayoutTime(int64 time) override; |
| 56 void GetStartupPerformanceTimes( |
| 57 const GetStartupPerformanceTimesCallback& callback) override; |
| 58 |
42 void AllDataCollected(); | 59 void AllDataCollected(); |
43 | 60 |
44 scoped_ptr<TraceDataSink> sink_; | 61 scoped_ptr<TraceDataSink> sink_; |
45 ScopedVector<CollectorImpl> collector_impls_; | 62 ScopedVector<CollectorImpl> collector_impls_; |
46 mojo::WeakInterfacePtrSet<TraceController> controller_ptrs_; | 63 mojo::WeakInterfacePtrSet<TraceController> controller_ptrs_; |
47 mojo::WeakBindingSet<TraceCoordinator> coordinator_bindings_; | 64 mojo::WeakBindingSet<TraceCoordinator> coordinator_bindings_; |
| 65 mojo::WeakBindingSet<StartupPerformanceController> |
| 66 startup_performance_controller_bindings_; |
| 67 StartupPerformanceTimes startup_performance_times_; |
48 | 68 |
49 DISALLOW_COPY_AND_ASSIGN(TracingApp); | 69 DISALLOW_COPY_AND_ASSIGN(TracingApp); |
50 }; | 70 }; |
51 | 71 |
52 } // namespace tracing | 72 } // namespace tracing |
53 | 73 |
54 #endif // MOJO_SERVICES_TRACING_TRACING_APP_H_ | 74 #endif // MOJO_SERVICES_TRACING_TRACING_APP_H_ |
OLD | NEW |