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

Unified Diff: mojo/public/python/mojo_bindings/reflection.py

Issue 796373006: Content handler for python. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 months 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
Index: mojo/public/python/mojo_bindings/reflection.py
diff --git a/mojo/public/python/mojo_bindings/reflection.py b/mojo/public/python/mojo_bindings/reflection.py
index 5432691c3e783147eeb67d699b6a54ff413d7320..e7d25dd69a537554b7d686bb94094148faf44a88 100644
--- a/mojo/public/python/mojo_bindings/reflection.py
+++ b/mojo/public/python/mojo_bindings/reflection.py
@@ -282,7 +282,7 @@ class InterfaceManager(object):
# Give an instance manager to the implementation to allow it to close
# the connection.
- impl.manager = InstanceManager(router)
+ impl.manager = InstanceManager(router, error_handler)
router.Start()
@@ -304,7 +304,7 @@ class InterfaceManager(object):
proxy = self._proxy_class(router, error_handler)
# Give an instance manager to the proxy to allow to close the connection.
- proxy.manager = InstanceManager(router)
+ proxy.manager = InstanceManager(router, error_handler)
return proxy
def _Stub(self, impl):
@@ -327,14 +327,18 @@ class InstanceManager(object):
Manager for the implementation of an interface or a proxy. The manager allows
to control the connection over the pipe.
"""
- def __init__(self, router):
- self.router = router
+ def __init__(self, router, error_handler):
+ self._router = router
+ self._error_handler = error_handler
def Close(self):
- self.router.Close()
+ self._router.Close()
def PassMessagePipe(self):
- return self.router.PassMessagePipe()
+ return self._router.PassMessagePipe()
+
+ def AddOnErrorCallback(self, callback):
+ self._error_handler.AddCallback(lambda _: callback())
class _MethodDescriptor(object):

Powered by Google App Engine
This is Rietveld 408576698