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

Side by Side Diff: mojo/public/python/mojo/bindings/messaging.py

Issue 643853004: mojo: Update PRESBUMIT.py (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 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 """Utility classes to handle sending and receiving messages.""" 5 """Utility classes to handle sending and receiving messages."""
6 6
7 7
8 import struct 8 import struct
9 import weakref 9 import weakref
10 10
11 # pylint: disable=F0401
12 import mojo.bindings.serialization as serialization 11 import mojo.bindings.serialization as serialization
12
13 # pylint: disable=E0611,F0401
13 import mojo.system as system 14 import mojo.system as system
14 15
15 16
16 # The flag values for a message header. 17 # The flag values for a message header.
17 NO_FLAG = 0 18 NO_FLAG = 0
18 MESSAGE_EXPECTS_RESPONSE_FLAG = 1 << 0 19 MESSAGE_EXPECTS_RESPONSE_FLAG = 1 << 0
19 MESSAGE_IS_RESPONSE_FLAG = 1 << 1 20 MESSAGE_IS_RESPONSE_FLAG = 1 << 1
20 21
21 22
22 class MessageHeader(object): 23 class MessageHeader(object):
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 message_receiver.Accept(Message(bytearray(), [])) 379 message_receiver.Accept(Message(bytearray(), []))
379 if result != system.RESULT_RESOURCE_EXHAUSTED: 380 if result != system.RESULT_RESOURCE_EXHAUSTED:
380 return result 381 return result
381 (result, data, _) = handle.ReadMessage(bytearray(sizes[0])) 382 (result, data, _) = handle.ReadMessage(bytearray(sizes[0]))
382 if result == system.RESULT_OK and message_receiver: 383 if result == system.RESULT_OK and message_receiver:
383 message_receiver.Accept(Message(data[0], data[1])) 384 message_receiver.Accept(Message(data[0], data[1]))
384 return result 385 return result
385 386
386 def _HasRequestId(flags): 387 def _HasRequestId(flags):
387 return flags & (MESSAGE_EXPECTS_RESPONSE_FLAG|MESSAGE_IS_RESPONSE_FLAG) != 0 388 return flags & (MESSAGE_EXPECTS_RESPONSE_FLAG|MESSAGE_IS_RESPONSE_FLAG) != 0
OLDNEW
« no previous file with comments | « mojo/public/python/mojo/bindings/descriptor.py ('k') | mojo/python/tests/async_wait_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698