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

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

Issue 703273002: Update mojo sdk to rev 04a510fb37db10642e156957f9b2c11c2f6442ac (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix content/child -> mojo/common linking Created 6 years, 1 month 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/python/mojo/bindings/descriptor.py ('k') | mojo/public/python/mojo/bindings/reflection.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 fb1263ef55a912c0665bcf99df5e669dde3af861..f9061fb856bd279a2d91d1563bc03632a38b30cb 100644
--- a/mojo/public/python/mojo/bindings/messaging.py
+++ b/mojo/public/python/mojo/bindings/messaging.py
@@ -247,6 +247,14 @@ class Connector(MessageReceiver):
self._cancellable = None
self._handle.Close()
+ def PassMessagePipe(self):
+ if self._cancellable:
+ self._cancellable()
+ self._cancellable = None
+ result = self._handle
+ self._handle = system.Handle()
+ return result
+
def _OnAsyncWaiterResult(self, result):
self._cancellable = None
if result == system.RESULT_OK:
@@ -319,7 +327,7 @@ class Router(MessageReceiverWithResponder):
# The message must have a header.
header = message.header
assert header.expects_response
- request_id = self.NextRequestId()
+ request_id = self._NextRequestId()
header.request_id = request_id
if not self._connector.Accept(message):
return False
@@ -329,6 +337,9 @@ class Router(MessageReceiverWithResponder):
def Close(self):
self._connector.Close()
+ def PassMessagePipe(self):
+ return self._connector.PassMessagePipe()
+
def _HandleIncomingMessage(self, message):
header = message.header
if header.expects_response:
@@ -350,7 +361,7 @@ class Router(MessageReceiverWithResponder):
# Ok to drop the message
return False
- def NextRequestId(self):
+ def _NextRequestId(self):
request_id = self._next_request_id
while request_id == 0 or request_id in self._responders:
request_id = (request_id + 1) % (1 << 64)
« no previous file with comments | « mojo/public/python/mojo/bindings/descriptor.py ('k') | mojo/public/python/mojo/bindings/reflection.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698