OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #include <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 | 190 |
191 // InterfaceFactory<test::mojom::ConnectTestService>: | 191 // InterfaceFactory<test::mojom::ConnectTestService>: |
192 void Create(const Identity& remote_identity, | 192 void Create(const Identity& remote_identity, |
193 test::mojom::ConnectTestServiceRequest request) override { | 193 test::mojom::ConnectTestServiceRequest request) override { |
194 bindings_.AddBinding(this, std::move(request)); | 194 bindings_.AddBinding(this, std::move(request)); |
195 } | 195 } |
196 | 196 |
197 // mojom::ServiceFactory: | 197 // mojom::ServiceFactory: |
198 void CreateService(mojom::ServiceRequest request, | 198 void CreateService(mojom::ServiceRequest request, |
199 const std::string& name) override { | 199 const std::string& name) override { |
200 if (name == "mojo:connect_test_a") | 200 if (name == "service:connect_test_a") |
201 new ProvidedService("A", std::move(request)); | 201 new ProvidedService("A", std::move(request)); |
202 else if (name == "mojo:connect_test_b") | 202 else if (name == "service:connect_test_b") |
203 new ProvidedService("B", std::move(request)); | 203 new ProvidedService("B", std::move(request)); |
204 } | 204 } |
205 | 205 |
206 // test::mojom::ConnectTestService: | 206 // test::mojom::ConnectTestService: |
207 void GetTitle(const GetTitleCallback& callback) override { | 207 void GetTitle(const GetTitleCallback& callback) override { |
208 callback.Run("ROOT"); | 208 callback.Run("ROOT"); |
209 } | 209 } |
210 void GetInstance(const GetInstanceCallback& callback) override { | 210 void GetInstance(const GetInstanceCallback& callback) override { |
211 callback.Run(identity_.instance()); | 211 callback.Run(identity_.instance()); |
212 } | 212 } |
(...skipping 10 matching lines...) Expand all Loading... |
223 | 223 |
224 DISALLOW_COPY_AND_ASSIGN(ConnectTestService); | 224 DISALLOW_COPY_AND_ASSIGN(ConnectTestService); |
225 }; | 225 }; |
226 | 226 |
227 } // namespace shell | 227 } // namespace shell |
228 | 228 |
229 MojoResult ServiceMain(MojoHandle service_request_handle) { | 229 MojoResult ServiceMain(MojoHandle service_request_handle) { |
230 shell::ServiceRunner runner(new shell::ConnectTestService); | 230 shell::ServiceRunner runner(new shell::ConnectTestService); |
231 return runner.Run(service_request_handle); | 231 return runner.Run(service_request_handle); |
232 } | 232 } |
OLD | NEW |