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

Unified Diff: mojo/public/python/mojo/bindings/messaging.py

Issue 695583002: Update mojo sdk to rev e083961bf11fd0c94d40be8853761da529b6d444 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Patch in https://codereview.chromium.org/692823003 Created 6 years, 2 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
« no previous file with comments | « mojo/public/js/bindings/core_unittests.js ('k') | mojo/public/python/mojo/bindings/promise.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/python/mojo/bindings/messaging.py
diff --git a/mojo/public/python/mojo/bindings/messaging.py b/mojo/public/python/mojo/bindings/messaging.py
index e5a765e1d618135cef191312dc5be1cd2e8f2bd9..fb1263ef55a912c0665bcf99df5e669dde3af861 100644
--- a/mojo/public/python/mojo/bindings/messaging.py
+++ b/mojo/public/python/mojo/bindings/messaging.py
@@ -6,6 +6,7 @@
import struct
+import sys
import weakref
import mojo.bindings.serialization as serialization
@@ -20,6 +21,12 @@ MESSAGE_EXPECTS_RESPONSE_FLAG = 1 << 0
MESSAGE_IS_RESPONSE_FLAG = 1 << 1
+class MessagingException(Exception):
+ def __init__(self, *args, **kwargs):
+ Exception.__init__(self, *args, **kwargs)
+ self.__traceback__ = sys.exc_info()[2]
+
+
class MessageHeader(object):
"""The header of a mojo message."""
@@ -117,10 +124,10 @@ class MessageHeader(object):
class Message(object):
"""A message for a message pipe. This contains data and handles."""
- def __init__(self, data=None, handles=None):
+ def __init__(self, data=None, handles=None, header=None):
self.data = data
self.handles = handles
- self._header = None
+ self._header = header
self._payload = None
@property
@@ -251,6 +258,7 @@ class Connector(MessageReceiver):
assert not self._cancellable
if self._error_handler:
self._error_handler.OnError(result)
+ self._handle.Close()
def _RegisterAsyncWaiterForRead(self) :
assert not self._cancellable
@@ -284,7 +292,7 @@ class Router(MessageReceiverWithResponder):
self._responders = {}
self._connector = Connector(handle)
self._connector.SetIncomingMessageReceiver(
- ForwardingMessageReceiver(self._HandleIncomingMessage))
+ ForwardingMessageReceiver(_WeakCallback(self._HandleIncomingMessage)))
def Start(self):
self._connector.Start()
« no previous file with comments | « mojo/public/js/bindings/core_unittests.js ('k') | mojo/public/python/mojo/bindings/promise.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698