| 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 #ifndef CONTENT_PUBLIC_TEST_TEST_SERVICE_H_ | 5 #ifndef CONTENT_PUBLIC_TEST_TEST_SERVICE_H_ |
| 6 #define CONTENT_PUBLIC_TEST_TEST_SERVICE_H_ | 6 #define CONTENT_PUBLIC_TEST_TEST_SERVICE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "content/public/test/test_service.mojom.h" | 11 #include "content/public/test/test_service.mojom.h" |
| 12 #include "mojo/public/cpp/bindings/binding.h" | 12 #include "mojo/public/cpp/bindings/binding.h" |
| 13 #include "services/service_manager/public/cpp/interface_factory.h" | 13 #include "services/service_manager/public/cpp/interface_factory.h" |
| 14 #include "services/service_manager/public/cpp/service.h" | 14 #include "services/service_manager/public/cpp/service.h" |
| 15 | 15 |
| 16 namespace content { | 16 namespace content { |
| 17 | 17 |
| 18 extern const char kTestServiceUrl[]; | 18 extern const char kTestServiceUrl[]; |
| 19 | 19 |
| 20 // Simple Service which provides a mojom::TestService impl. The service | 20 // Simple Service which provides a mojom::TestService impl. The service |
| 21 // terminates itself after its TestService fulfills a single DoSomething call. | 21 // terminates itself after its TestService fulfills a single DoSomething call. |
| 22 class TestService : public shell::Service, | 22 class TestService |
| 23 public shell::InterfaceFactory<mojom::TestService>, | 23 : public service_manager::Service, |
| 24 public mojom::TestService { | 24 public service_manager::InterfaceFactory<mojom::TestService>, |
| 25 public mojom::TestService { |
| 25 public: | 26 public: |
| 26 TestService(); | 27 TestService(); |
| 27 ~TestService() override; | 28 ~TestService() override; |
| 28 | 29 |
| 29 private: | 30 private: |
| 30 // shell::Service: | 31 // service_manager::Service: |
| 31 bool OnConnect(const shell::Identity& remote_identity, | 32 bool OnConnect(const service_manager::Identity& remote_identity, |
| 32 shell::InterfaceRegistry* registry) override; | 33 service_manager::InterfaceRegistry* registry) override; |
| 33 | 34 |
| 34 // shell::InterfaceFactory<mojom::TestService>: | 35 // service_manager::InterfaceFactory<mojom::TestService>: |
| 35 void Create(const shell::Identity& remote_identity, | 36 void Create(const service_manager::Identity& remote_identity, |
| 36 mojom::TestServiceRequest request) override; | 37 mojom::TestServiceRequest request) override; |
| 37 | 38 |
| 38 // TestService: | 39 // TestService: |
| 39 void DoSomething(const DoSomethingCallback& callback) override; | 40 void DoSomething(const DoSomethingCallback& callback) override; |
| 40 void DoTerminateProcess(const DoTerminateProcessCallback& callback) override; | 41 void DoTerminateProcess(const DoTerminateProcessCallback& callback) override; |
| 41 void CreateFolder(const CreateFolderCallback& callback) override; | 42 void CreateFolder(const CreateFolderCallback& callback) override; |
| 42 void GetRequestorName(const GetRequestorNameCallback& callback) override; | 43 void GetRequestorName(const GetRequestorNameCallback& callback) override; |
| 43 void CreateSharedBuffer(const std::string& message, | 44 void CreateSharedBuffer(const std::string& message, |
| 44 const CreateSharedBufferCallback& callback) override; | 45 const CreateSharedBufferCallback& callback) override; |
| 45 | 46 |
| 46 mojo::Binding<mojom::TestService> service_binding_; | 47 mojo::Binding<mojom::TestService> service_binding_; |
| 47 | 48 |
| 48 // The name of the app connecting to us. | 49 // The name of the app connecting to us. |
| 49 std::string requestor_name_; | 50 std::string requestor_name_; |
| 50 | 51 |
| 51 DISALLOW_COPY_AND_ASSIGN(TestService); | 52 DISALLOW_COPY_AND_ASSIGN(TestService); |
| 52 }; | 53 }; |
| 53 | 54 |
| 54 } // namespace content | 55 } // namespace content |
| 55 | 56 |
| 56 #endif // CONTENT_PUBLIC_TEST_TEST_SERVICE_H_ | 57 #endif // CONTENT_PUBLIC_TEST_TEST_SERVICE_H_ |
| OLD | NEW |