Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(703)

Unified Diff: mojo/public/python/mojo_application/application_impl.py

Issue 1508613003: Require an explicit ServiceName annotation for interfaces in Python. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | mojo/public/python/mojo_application/service_provider_impl.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/python/mojo_application/application_impl.py
diff --git a/mojo/public/python/mojo_application/application_impl.py b/mojo/public/python/mojo_application/application_impl.py
index 80b0376853e512a03f658b32d4a81faa2121e44c..4a4b898c073da1214aea2f031b247db9cd199e25 100644
--- a/mojo/public/python/mojo_application/application_impl.py
+++ b/mojo/public/python/mojo_application/application_impl.py
@@ -4,6 +4,8 @@
"""Python implementation of the Application interface."""
+import logging
+
import application_mojom
import service_provider_mojom
import shell_mojom
@@ -46,12 +48,15 @@ class ApplicationImpl(application_mojom.Application):
application to be connected to, and |service_class| is the class of the
service to be connected to. Returns a proxy to the service.
"""
+ if not service_class.manager.service_name:
+ logging.error("No ServiceName specified for %s." % service_class.__name__)
+ return
application_proxy, request = (
service_provider_mojom.ServiceProvider.manager.NewRequest())
self.shell.ConnectToApplication(application_url, request, None)
service_proxy, request = service_class.manager.NewRequest()
- application_proxy.ConnectToService(service_class.manager.name,
+ application_proxy.ConnectToService(service_class.manager.service_name,
request.PassMessagePipe())
return service_proxy
« no previous file with comments | « no previous file | mojo/public/python/mojo_application/service_provider_impl.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698