Index: third_party/mojo/src/mojo/public/dart/src/message.dart |
diff --git a/third_party/mojo/src/mojo/public/dart/src/message.dart b/third_party/mojo/src/mojo/public/dart/src/message.dart |
index 9c7cf463112af41ceade6e7a837947d3756109a1..3cfe2fbdc30fb73b2dbd5522a67927df6fc933bb 100644 |
--- a/third_party/mojo/src/mojo/public/dart/src/message.dart |
+++ b/third_party/mojo/src/mojo/public/dart/src/message.dart |
@@ -27,29 +27,28 @@ class MessageHeader { |
static bool mustHaveRequestId(int flags) => |
(flags & (kMessageExpectsResponse | kMessageIsResponse)) != 0; |
- MessageHeader(this.type) : |
- _header = new StructDataHeader(kSimpleMessageSize, kSimpleMessageVersion), |
- flags = 0, |
- requestId = 0; |
+ MessageHeader(this.type) |
+ : _header = new StructDataHeader( |
+ kSimpleMessageSize, kSimpleMessageVersion), |
+ flags = 0, |
+ requestId = 0; |
- MessageHeader.withRequestId(this.type, this.flags, this.requestId) : |
- _header = new StructDataHeader( |
- kMessageWithRequestIdSize, kMessageWithRequestIdVersion); |
+ MessageHeader.withRequestId(this.type, this.flags, this.requestId) |
+ : _header = new StructDataHeader( |
+ kMessageWithRequestIdSize, kMessageWithRequestIdVersion); |
MessageHeader.fromMessage(Message message) { |
var decoder = new Decoder(message); |
_header = decoder.decodeStructDataHeader(); |
if (_header.size < kSimpleMessageSize) { |
- throw new MojoCodecError( |
- 'Incorrect message size. Got: ${_header.size} ' |
+ throw new MojoCodecError('Incorrect message size. Got: ${_header.size} ' |
'wanted $kSimpleMessageSize'); |
} |
type = decoder.decodeUint32(kMessageTypeOffset); |
flags = decoder.decodeUint32(kMessageFlagsOffset); |
if (mustHaveRequestId(flags)) { |
if (_header.size < kMessageWithRequestIdSize) { |
- throw new MojoCodecError( |
- 'Incorrect message size. Got: ${_header.size} ' |
+ throw new MojoCodecError('Incorrect message size. Got: ${_header.size} ' |
'wanted $kMessageWithRequestIdSize'); |
} |
requestId = decoder.decodeUint64(kMessageRequestIdOffset); |
@@ -70,8 +69,6 @@ class MessageHeader { |
} |
} |
- ServiceMessage get serviceMessage => new ServiceMessage(this); |
- |
String toString() => "MessageHeader($_header, $type, $flags, $requestId)"; |
bool validateHeaderFlags(expectedFlags) => |
@@ -83,28 +80,27 @@ class MessageHeader { |
static void _validateDataHeader(StructDataHeader dataHeader) { |
if (dataHeader.version < kSimpleMessageVersion) { |
throw 'Incorrect version, expecting at least ' |
- '$kSimpleMessageVersion, but got: ${dataHeader.version}.'; |
+ '$kSimpleMessageVersion, but got: ${dataHeader.version}.'; |
} |
if (dataHeader.size < kSimpleMessageSize) { |
throw 'Incorrect message size, expecting at least $kSimpleMessageSize, ' |
- 'but got: ${dataHeader.size}'; |
+ 'but got: ${dataHeader.size}'; |
} |
if ((dataHeader.version == kSimpleMessageVersion) && |
(dataHeader.size != kSimpleMessageSize)) { |
throw 'Incorrect message size for a message of version ' |
- '$kSimpleMessageVersion, expecting $kSimpleMessageSize, ' |
- 'but got ${dataHeader.size}'; |
+ '$kSimpleMessageVersion, expecting $kSimpleMessageSize, ' |
+ 'but got ${dataHeader.size}'; |
} |
if ((dataHeader.version == kMessageWithRequestIdVersion) && |
(dataHeader.size != kMessageWithRequestIdSize)) { |
throw 'Incorrect message size for a message of version ' |
- '$kMessageWithRequestIdVersion, expecting ' |
- '$kMessageWithRequestIdSize, but got ${dataHeader.size}'; |
+ '$kMessageWithRequestIdVersion, expecting ' |
+ '$kMessageWithRequestIdSize, but got ${dataHeader.size}'; |
} |
} |
} |
- |
class Message { |
final ByteData buffer; |
final List<core.MojoHandle> handles; |
@@ -113,7 +109,6 @@ class Message { |
"Message(numBytes=${buffer.lengthInBytes}, numHandles=${handles.length})"; |
} |
- |
class ServiceMessage extends Message { |
final MessageHeader header; |
Message _payload; |