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

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

Issue 1410053002: Dart: Uses a pre-allocated buffer for message pipe query and read. (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/proxy.dart ('k') | mojo/public/dart/mojo/sdk_ext/src/natives.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/stub.dart
diff --git a/mojo/public/dart/mojo/lib/src/stub.dart b/mojo/public/dart/mojo/lib/src/stub.dart
index 7ea00593e1f318f7a5b8e9899e5e6482831f0eaf..420bc86d02e52f793b2630424247c5462ebfa246 100644
--- a/mojo/public/dart/mojo/lib/src/stub.dart
+++ b/mojo/public/dart/mojo/lib/src/stub.dart
@@ -20,7 +20,7 @@ abstract class Stub extends core.MojoEventStreamListener {
void handleRead() {
var result = endpoint.queryAndRead();
- if ((result.bytesRead == null) || (result.bytesRead.length == 0)) {
+ if ((result.data == null) || (result.dataLength == 0)) {
throw new MojoCodecError('Unexpected empty message or error: $result');
}
@@ -28,12 +28,12 @@ abstract class Stub extends core.MojoEventStreamListener {
var message;
var response;
try {
- message = new ServiceMessage.fromMessage(
- new Message(result.bytesRead, result.handlesRead));
+ message = new ServiceMessage.fromMessage(new Message(result.data,
+ result.handles, result.dataLength, result.handlesLength));
response = _isClosing ? null : handleMessage(message);
} catch (e) {
- if (result.handlesRead != null) {
- result.handlesRead.forEach((h) => h.close());
+ if (result.handles != null) {
+ result.handles.forEach((h) => h.close());
}
rethrow;
}
« no previous file with comments | « mojo/public/dart/mojo/lib/src/proxy.dart ('k') | mojo/public/dart/mojo/sdk_ext/src/natives.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698