| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 SERVICES_SERVICE_MANAGER_PUBLIC_CPP_SERVICE_H_ | 5 #ifndef SERVICES_SERVICE_MANAGER_PUBLIC_CPP_SERVICE_H_ |
| 6 #define SERVICES_SERVICE_MANAGER_PUBLIC_CPP_SERVICE_H_ | 6 #define SERVICES_SERVICE_MANAGER_PUBLIC_CPP_SERVICE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 // just blindly bind it under most conditions. | 45 // just blindly bind it under most conditions. |
| 46 virtual void OnBindInterface(const ServiceInfo& source_info, | 46 virtual void OnBindInterface(const ServiceInfo& source_info, |
| 47 const std::string& interface_name, | 47 const std::string& interface_name, |
| 48 mojo::ScopedMessagePipeHandle interface_pipe); | 48 mojo::ScopedMessagePipeHandle interface_pipe); |
| 49 | 49 |
| 50 // Called when the Service Manager has stopped tracking this instance. The | 50 // Called when the Service Manager has stopped tracking this instance. The |
| 51 // service should use this as a signal to shut down, and in fact its process | 51 // service should use this as a signal to shut down, and in fact its process |
| 52 // may be reaped shortly afterward if applicable. | 52 // may be reaped shortly afterward if applicable. |
| 53 // | 53 // |
| 54 // Return true from this method to tell the ServiceContext to signal its | 54 // Return true from this method to tell the ServiceContext to signal its |
| 55 // shutdown extenrally (i.e. to invoke it's "connection lost" closure if set), | 55 // shutdown externally (i.e. to invoke its "connection lost" closure if set), |
| 56 // or return false to defer the signal. If deferred, the Service should | 56 // or return false to defer the signal. If deferred, the Service should |
| 57 // explicitly call QuitNow() on the ServiceContext when it's ready to be | 57 // explicitly call QuitNow() on the ServiceContext when it's ready to be |
| 58 // torn down. | 58 // torn down. |
| 59 // | 59 // |
| 60 // The default implementation returns true. | 60 // The default implementation returns true. |
| 61 // | 61 // |
| 62 // While it's possible for this to be invoked before either OnStart() or | 62 // While it's possible for this to be invoked before either OnStart() or |
| 63 // OnConnect() is invoked, neither will be invoked at any point after this | 63 // OnConnect() is invoked, neither will be invoked at any point after this |
| 64 // OnStop(). | 64 // OnStop(). |
| 65 virtual bool OnStop(); | 65 virtual bool OnStop(); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 | 99 |
| 100 private: | 100 private: |
| 101 Service* const target_ = nullptr; | 101 Service* const target_ = nullptr; |
| 102 | 102 |
| 103 DISALLOW_COPY_AND_ASSIGN(ForwardingService); | 103 DISALLOW_COPY_AND_ASSIGN(ForwardingService); |
| 104 }; | 104 }; |
| 105 | 105 |
| 106 } // namespace service_manager | 106 } // namespace service_manager |
| 107 | 107 |
| 108 #endif // SERVICES_SERVICE_MANAGER_PUBLIC_CPP_SERVICE_H_ | 108 #endif // SERVICES_SERVICE_MANAGER_PUBLIC_CPP_SERVICE_H_ |
| OLD | NEW |