| 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/binder_registry.h" | |
| 14 #include "services/service_manager/public/cpp/service.h" | |
| 15 #include "services/service_manager/public/cpp/service_context_ref.h" | |
| 16 | |
| 17 namespace resource_coordinator { | |
| 18 | |
| 19 class ResourceCoordinatorService : public service_manager::Service { | |
| 20 public: | |
| 21 ResourceCoordinatorService(); | |
| 22 ~ResourceCoordinatorService() override; | |
| 23 | |
| 24 // service_manager::Service: | |
| 25 // Factory function for use as an embedded service. | |
| 26 static std::unique_ptr<service_manager::Service> Create(); | |
| 27 | |
| 28 // service_manager::Service: | |
| 29 void OnStart() override; | |
| 30 void OnBindInterface(const service_manager::BindSourceInfo& source_info, | |
| 31 const std::string& interface_name, | |
| 32 mojo::ScopedMessagePipeHandle interface_pipe) override; | |
| 33 | |
| 34 private: | |
| 35 service_manager::BinderRegistry registry_; | |
| 36 std::unique_ptr<service_manager::ServiceContextRefFactory> ref_factory_; | |
| 37 | |
| 38 // WeakPtrFactory members should always come last so WeakPtrs are destructed | |
| 39 // before other members. | |
| 40 base::WeakPtrFactory<ResourceCoordinatorService> weak_factory_; | |
| 41 | |
| 42 DISALLOW_COPY_AND_ASSIGN(ResourceCoordinatorService); | |
| 43 }; | |
| 44 | |
| 45 } // namespace resource_coordinator | |
| 46 | |
| 47 #endif // SERVICES_SPEED_SPEED_SERVICE_H_ | |
| OLD | NEW |