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

Unified Diff: third_party/mojo/src/mojo/public/dart/src/message.dart

Issue 1019173002: Update mojo sdk to rev 7214b7ec7d27563b2666afad86cf1c5895c56c18 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Keep permission service alive if embedder drops requests Created 5 years, 9 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: 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;

Powered by Google App Engine
This is Rietveld 408576698