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

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

Issue 1998433002: Dart: Adds Interface and InterfaceRequest interfaces. (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
« no previous file with comments | « mojo/dart/packages/mojo/lib/src/proxy.dart ('k') | mojo/dart/packages/mojo/sources.gni » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/dart/packages/mojo/lib/src/stub.dart
diff --git a/mojo/dart/packages/mojo/lib/src/stub.dart b/mojo/dart/packages/mojo/lib/src/stub.dart
index a076533667d15204959653b14a2e9a07b44010f3..88715488838a35c0ded53af59b445248cff127e4 100644
--- a/mojo/dart/packages/mojo/lib/src/stub.dart
+++ b/mojo/dart/packages/mojo/lib/src/stub.dart
@@ -7,11 +7,16 @@ part of bindings;
/// Generated StubControl classes implement this interface.
/// StubControl objects are accessible through the [ctrl] field on Stubs.
abstract class StubControl<T> implements StubMessageHandler {
+ // TODO(zra): This is only used by ApplicationConnection.requestService(), so
+ // try to remove when/after ApplicationConnection is removed/refactored.
+ String get serviceName;
+
+ /// [impl] refers to the implementation of the methods of the interface T.
T impl;
}
/// Generated Stub classes extend this base class.
-class Stub<T> {
+class Stub<T> implements MojoInterface<T> {
// In general it's probalby better to avoid adding fields and methods to this
// class. Names added to this class have to be mangled by Mojo bindings
// generation to avoid name conflicts.
@@ -28,7 +33,7 @@ class Stub<T> {
Future close({bool immediate: false}) => ctrl.close(immediate: immediate);
/// This getter and setter pair is for convenience and simply forwards to
- /// ctrl.impl. If a Mojo interface has a method 'close', its name will be
+ /// ctrl.impl. If a Mojo interface has a method 'impl', its name will be
/// mangled to be 'impl_'.
T get impl => ctrl.impl;
set impl(T impl) {
@@ -36,7 +41,8 @@ class Stub<T> {
}
}
-abstract class StubMessageHandler extends core.MojoEventHandler {
+abstract class StubMessageHandler extends core.MojoEventHandler
+ implements MojoInterfaceControl {
int _outstandingResponseFutures = 0;
bool _isClosing = false;
Completer _closeCompleter;
« no previous file with comments | « mojo/dart/packages/mojo/lib/src/proxy.dart ('k') | mojo/dart/packages/mojo/sources.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698