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

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

Issue 1983453002: Dart: Refactor Stubs (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Merge Created 4 years, 7 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: mojo/dart/packages/mojo/lib/src/codec.dart
diff --git a/mojo/dart/packages/mojo/lib/src/codec.dart b/mojo/dart/packages/mojo/lib/src/codec.dart
index 5fd7ac6242de4f8af6c40bfdf955b108aa4c70cf..46d82b51b89cc4e2ea746efe47585d73ab2e61b1 100644
--- a/mojo/dart/packages/mojo/lib/src/codec.dart
+++ b/mojo/dart/packages/mojo/lib/src/codec.dart
@@ -218,15 +218,15 @@ class Encoder {
return;
}
if (interface is Stub) {
- if (interface.isBound) {
+ if (interface.ctrl.isBound) {
throw new MojoCodecError(
'Cannot encode a bound stub for an interface');
}
var pipe = new core.MojoMessagePipe();
- interface.bind(pipe.endpoints[0]);
+ interface.ctrl.bind(pipe.endpoints[0]);
encodeMessagePipeHandle(pipe.endpoints[1], offset, nullable);
// Set the version to the version in the stub.
- encodeUint32(interface.version, offset + kSerializedHandleSize);
+ encodeUint32(interface.ctrl.version, offset + kSerializedHandleSize);
} else if (interface is Proxy) {
if (!interface.ctrl.isBound) {
throw new MojoCodecError(
@@ -260,18 +260,18 @@ class Encoder {
request.ctrl.beginHandlingEvents();
encodeMessagePipeHandle(pipe.endpoints[1], offset, nullable);
} else if (request is Stub) {
- if (!request.isBound) {
+ if (!request.ctrl.isBound) {
throw new MojoCodecError(
'Cannot encode an unbound stub for an interface request');
}
- if (!request.isOpen) {
+ if (!request.ctrl.isOpen) {
// Make sure that we are listening so that state for the stub is
// cleaned up when the message is sent and the handle is closed.
- request.beginHandlingEvents();
+ request.ctrl.beginHandlingEvents();
}
- encodeMessagePipeHandle(request.endpoint, offset, nullable);
+ encodeMessagePipeHandle(request.ctrl.endpoint, offset, nullable);
// Set the version to the current version of the stub.
- encodeUint32(request.version, offset + kSerializedHandleSize);
+ encodeUint32(request.ctrl.version, offset + kSerializedHandleSize);
}
}
« no previous file with comments | « mojo/dart/packages/mojo/lib/src/application_connection.dart ('k') | mojo/dart/packages/mojo/lib/src/control_message.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698