OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef SERVICES_SPEED_SPEED_SERVICE_H_ |
| 6 #define SERVICES_SPEED_SPEED_SERVICE_H_ |
| 7 |
| 8 #include <memory> |
| 9 |
| 10 #include "base/callback.h" |
| 11 #include "base/macros.h" |
| 12 #include "base/memory/weak_ptr.h" |
| 13 #include "services/service_manager/public/cpp/service.h" |
| 14 #include "services/service_manager/public/cpp/service_context_ref.h" |
| 15 |
| 16 namespace resource_coordinator { |
| 17 |
| 18 class ResourceCoordinatorService : public service_manager::Service { |
| 19 public: |
| 20 ResourceCoordinatorService(); |
| 21 ~ResourceCoordinatorService() override; |
| 22 |
| 23 // service_manager::Service: |
| 24 // Factory function for use as an embedded service. |
| 25 static std::unique_ptr<service_manager::Service> Create(); |
| 26 |
| 27 // service_manager::Service: |
| 28 void OnStart() override; |
| 29 bool OnConnect(const service_manager::ServiceInfo& remote_info, |
| 30 service_manager::InterfaceRegistry* registry) override; |
| 31 |
| 32 private: |
| 33 void MaybeRequestQuitDelayed(); |
| 34 void MaybeRequestQuit(); |
| 35 |
| 36 std::unique_ptr<service_manager::ServiceContextRefFactory> ref_factory_; |
| 37 base::WeakPtrFactory<ResourceCoordinatorService> weak_factory_; |
| 38 |
| 39 DISALLOW_COPY_AND_ASSIGN(ResourceCoordinatorService); |
| 40 }; |
| 41 |
| 42 } // namespace resource_coordinator |
| 43 |
| 44 #endif // SERVICES_SPEED_SPEED_SERVICE_H_ |
OLD | NEW |