| 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 MOJO_PUBLIC_SHELL_SERVICE_H_ | 5 #ifndef MOJO_PUBLIC_SHELL_SERVICE_H_ |
| 6 #define MOJO_PUBLIC_SHELL_SERVICE_H_ | 6 #define MOJO_PUBLIC_SHELL_SERVICE_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "mojo/public/bindings/error_handler.h" | 10 #include "mojo/public/bindings/error_handler.h" |
| 11 #include "mojo/public/bindings/remote_ptr.h" | 11 #include "mojo/public/bindings/remote_ptr.h" |
| 12 #include "mojo/public/shell/shell.mojom.h" |
| 12 #include "mojo/public/system/core_cpp.h" | 13 #include "mojo/public/system/core_cpp.h" |
| 13 #include "mojom/shell.h" | |
| 14 | 14 |
| 15 // Utility classes for creating ShellClients that vend service instances. | 15 // Utility classes for creating ShellClients that vend service instances. |
| 16 // To use define a class that implements your specific server api, e.g. FooImpl | 16 // To use define a class that implements your specific server api, e.g. FooImpl |
| 17 // to implement a service named Foo. That class must define an empty constructor | 17 // to implement a service named Foo. That class must define an empty constructor |
| 18 // and the Initialize() method. | 18 // and the Initialize() method. |
| 19 // class FooImpl : public Foo { | 19 // class FooImpl : public Foo { |
| 20 // public: | 20 // public: |
| 21 // FooImpl(); | 21 // FooImpl(); |
| 22 // void Initialize(ServiceFactory<FooImpl>* service_factory, | 22 // void Initialize(ServiceFactory<FooImpl>* service_factory, |
| 23 // ScopedMessagePipeHandle client_handle | 23 // ScopedMessagePipeHandle client_handle |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 }; | 175 }; |
| 176 friend class ServiceFactory<ServiceImpl, Context>; | 176 friend class ServiceFactory<ServiceImpl, Context>; |
| 177 Reaper reaper_; | 177 Reaper reaper_; |
| 178 ServiceFactory<ServiceImpl, Context>* service_factory_; | 178 ServiceFactory<ServiceImpl, Context>* service_factory_; |
| 179 RemotePtr<typename ServiceInterface::_Peer> client_; | 179 RemotePtr<typename ServiceInterface::_Peer> client_; |
| 180 }; | 180 }; |
| 181 | 181 |
| 182 } // namespace mojo | 182 } // namespace mojo |
| 183 | 183 |
| 184 #endif // MOJO_PUBLIC_SHELL_SERVICE_H_ | 184 #endif // MOJO_PUBLIC_SHELL_SERVICE_H_ |
| OLD | NEW |