| 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 #include "services/tracing/service.h" | 5 #include "services/tracing/service.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 Service::~Service() {} | 21 Service::~Service() {} |
| 22 | 22 |
| 23 bool Service::OnConnect(const service_manager::ServiceInfo& remote_info, | 23 bool Service::OnConnect(const service_manager::ServiceInfo& remote_info, |
| 24 service_manager::InterfaceRegistry* registry) { | 24 service_manager::InterfaceRegistry* registry) { |
| 25 registry->AddInterface<mojom::Factory>(this); | 25 registry->AddInterface<mojom::Factory>(this); |
| 26 registry->AddInterface<mojom::Collector>(this); | 26 registry->AddInterface<mojom::Collector>(this); |
| 27 registry->AddInterface<mojom::StartupPerformanceDataCollector>(this); | 27 registry->AddInterface<mojom::StartupPerformanceDataCollector>(this); |
| 28 return true; | 28 return true; |
| 29 } | 29 } |
| 30 | 30 |
| 31 bool Service::OnStop() { | 31 bool Service::OnServiceManagerConnectionLost() { |
| 32 // TODO(beng): This is only required because Service isn't run by | 32 // TODO(beng): This is only required because Service isn't run by |
| 33 // ServiceRunner - instead it's launched automatically by the standalone | 33 // ServiceRunner - instead it's launched automatically by the standalone |
| 34 // service manager. It shouldn't be. | 34 // service manager. It shouldn't be. |
| 35 base::MessageLoop::current()->QuitWhenIdle(); | 35 base::MessageLoop::current()->QuitWhenIdle(); |
| 36 return false; | 36 return false; |
| 37 } | 37 } |
| 38 | 38 |
| 39 void Service::Create(const service_manager::Identity& remote_identity, | 39 void Service::Create(const service_manager::Identity& remote_identity, |
| 40 mojom::FactoryRequest request) { | 40 mojom::FactoryRequest request) { |
| 41 bindings_.AddBinding(this, std::move(request)); | 41 bindings_.AddBinding(this, std::move(request)); |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 const GetStartupPerformanceTimesCallback& callback) { | 178 const GetStartupPerformanceTimesCallback& callback) { |
| 179 callback.Run(startup_performance_times_.Clone()); | 179 callback.Run(startup_performance_times_.Clone()); |
| 180 } | 180 } |
| 181 | 181 |
| 182 void Service::AllDataCollected() { | 182 void Service::AllDataCollected() { |
| 183 recorder_impls_.clear(); | 183 recorder_impls_.clear(); |
| 184 sink_.reset(); | 184 sink_.reset(); |
| 185 } | 185 } |
| 186 | 186 |
| 187 } // namespace tracing | 187 } // namespace tracing |
| OLD | NEW |