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

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

Issue 1405103002: Dart: Merge message pipe query and read into one native call. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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/dart/mojo/lib/src/codec.dart ('k') | mojo/public/dart/mojo/lib/src/message_pipe.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/dart/mojo/lib/src/message.dart
diff --git a/mojo/public/dart/mojo/lib/src/message.dart b/mojo/public/dart/mojo/lib/src/message.dart
index f81a98dc8165a6e7ba0c6bb49c17a3af9978ad25..55feee3b70522d5383802490f2b25b7c23a12624 100644
--- a/mojo/public/dart/mojo/lib/src/message.dart
+++ b/mojo/public/dart/mojo/lib/src/message.dart
@@ -24,14 +24,14 @@ class MessageHeader {
(flags & (kMessageExpectsResponse | kMessageIsResponse)) != 0;
MessageHeader(this.type)
- : _header = new StructDataHeader(
- kSimpleMessageSize, kSimpleMessageVersion),
+ : _header =
+ new StructDataHeader(kSimpleMessageSize, kSimpleMessageVersion),
flags = 0,
requestId = 0;
MessageHeader.withRequestId(this.type, this.flags, this.requestId)
: _header = new StructDataHeader(
- kMessageWithRequestIdSize, kMessageWithRequestIdVersion);
+ kMessageWithRequestIdSize, kMessageWithRequestIdVersion);
MessageHeader.fromMessage(Message message) {
var decoder = new Decoder(message);
@@ -77,9 +77,10 @@ class MessageHeader {
class Message {
final ByteData buffer;
final List<core.MojoHandle> handles;
+ int get numHandles => (handles == null) ? 0 : handles.length;
Message(this.buffer, this.handles);
String toString() =>
- "Message(numBytes=${buffer.lengthInBytes}, numHandles=${handles.length})";
+ "Message(numBytes=${buffer.lengthInBytes}, numHandles=${numHandles})";
}
class ServiceMessage extends Message {
« no previous file with comments | « mojo/public/dart/mojo/lib/src/codec.dart ('k') | mojo/public/dart/mojo/lib/src/message_pipe.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698