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

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

Issue 1414483010: Dart: Use a RawReceivePort to receive events for Mojo handles. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 1 month 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: mojo/public/dart/mojo/lib/src/codec.dart
diff --git a/mojo/public/dart/mojo/lib/src/codec.dart b/mojo/public/dart/mojo/lib/src/codec.dart
index 66b7464ec91e877300ff77902a7735f2f4bdb37b..b53ec4c24fe16e761dbd9a7d57aa59f6eeb97237 100644
--- a/mojo/public/dart/mojo/lib/src/codec.dart
+++ b/mojo/public/dart/mojo/lib/src/codec.dart
@@ -203,7 +203,7 @@ class Encoder {
encodeHandle(value != null ? value.handle : null, offset, nullable);
void encodeInterface(
- core.MojoEventStreamListener interface, int offset, bool nullable) {
+ core.MojoEventHandler interface, int offset, bool nullable) {
if (interface == null) {
encodeInvalideHandle(offset, nullable);
// Set the version field to 0.
@@ -214,7 +214,7 @@ class Encoder {
assert(!interface.isBound);
var pipe = new core.MojoMessagePipe();
interface.bind(pipe.endpoints[0]);
- interface.listen();
+ interface.beginHandlingEvents();
encodeMessagePipeHandle(pipe.endpoints[1], offset, nullable);
// Set the version to the version in the stub.
encodeUint32(interface.version, offset + kSerializedHandleSize);
@@ -223,14 +223,13 @@ class Encoder {
if (!interface.isOpen) {
// Make sure that we are listening so that state for the proxy is
// cleaned up when the message is sent and the handle is closed.
- interface.listen();
+ interface.beginHandlingEvents();
}
encodeMessagePipeHandle(interface.endpoint, offset, nullable);
// Set the version to the current version of the proxy.
encodeUint32(interface.version, offset + kSerializedHandleSize);
} else {
- throw new MojoCodecError(
- 'Trying to encode an unknown MojoEventStreamListener');
+ throw new MojoCodecError('Trying to encode an unknown MojoEventHandler');
}
}
@@ -241,7 +240,7 @@ class Encoder {
}
var pipe = new core.MojoMessagePipe();
client.impl.bind(pipe.endpoints[0]);
- client.impl.listen();
+ client.impl.beginHandlingEvents();
encodeMessagePipeHandle(pipe.endpoints[1], offset, nullable);
}
« no previous file with comments | « mojo/public/dart/mojo/lib/src/application_connection.dart ('k') | mojo/public/dart/mojo/lib/src/drain_data.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698