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 """Example python application implementing the Echo service.""" | 5 """Example python application implementing the Echo service.""" |
6 | 6 |
7 import logging | 7 import logging |
8 | 8 |
9 import example_service_mojom | 9 import example_service_mojom |
10 from mojo_application import application_delegate | 10 from mojo_application import application_delegate |
11 from mojo_application import service_provider_impl | 11 from mojo_application import service_provider_impl |
12 from mojo_application import application_runner | 12 from mojo_application import application_runner |
13 | 13 |
14 import mojo_system | 14 import mojo_system |
15 | 15 |
16 class ExampleApp(application_delegate.ApplicationDelegate): | 16 class ExampleApp(application_delegate.ApplicationDelegate): |
17 def OnAcceptConnection(self, service_provider, requestor_url, | 17 def OnAcceptConnection(self, |
| 18 requestor_url, |
| 19 resolved_url, |
| 20 service_provider, |
18 exposed_services): | 21 exposed_services): |
19 service_provider.AddService(ExampleServiceImpl) | 22 service_provider.AddService(ExampleServiceImpl) |
20 return True | 23 return True |
21 | 24 |
22 | 25 |
23 class ExampleServiceImpl(example_service_mojom.ExampleService): | 26 class ExampleServiceImpl(example_service_mojom.ExampleService): |
24 def Ping(self, ping_value): | 27 def Ping(self, ping_value): |
25 return ping_value | 28 return ping_value |
26 | 29 |
27 | 30 |
28 def MojoMain(app_request_handle): | 31 def MojoMain(app_request_handle): |
29 application_runner.RunMojoApplication(ExampleApp(), app_request_handle) | 32 application_runner.RunMojoApplication(ExampleApp(), app_request_handle) |
OLD | NEW |