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

Unified Diff: mojo/public/tools/bindings/generators/dart_templates/interface_definition.tmpl

Issue 982673002: Dart: Removes need to call listen(). (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Don't pile up callbacks Created 5 years, 10 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/public/tools/bindings/generators/dart_templates/interface_definition.tmpl
diff --git a/mojo/public/tools/bindings/generators/dart_templates/interface_definition.tmpl b/mojo/public/tools/bindings/generators/dart_templates/interface_definition.tmpl
index 16004f106cfeb22601d73f08cf78d2bd752fe6aa..26863338d6e9c6ca7b7bb8107b264951b6ded5c2 100644
--- a/mojo/public/tools/bindings/generators/dart_templates/interface_definition.tmpl
+++ b/mojo/public/tools/bindings/generators/dart_templates/interface_definition.tmpl
@@ -38,13 +38,10 @@ abstract class {{interface|name}} {
class {{interface|name}}ProxyImpl extends bindings.Proxy {
{{interface|name}}ProxyImpl.fromEndpoint(
- core.MojoMessagePipeEndpoint endpoint,
- {bool doListen: true, Function onClosed}) :
- super.fromEndpoint(endpoint, doListen: doListen, onClosed: onClosed);
+ core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint);
- {{interface|name}}ProxyImpl.fromHandle(core.MojoHandle handle,
- {bool doListen: true, Function onClosed}) :
- super.fromHandle(handle, doListen: doListen, onClosed: onClosed);
+ {{interface|name}}ProxyImpl.fromHandle(core.MojoHandle handle) :
+ super.fromHandle(handle);
{{interface|name}}ProxyImpl.unbound() : super.unbound();
@@ -133,17 +130,13 @@ class {{interface|name}}Proxy implements bindings.ProxyBase {
ptr = new _{{interface|name}}ProxyCalls(proxyImpl);
{{interface|name}}Proxy.fromEndpoint(
- core.MojoMessagePipeEndpoint endpoint,
- {bool doListen: true, Function onClosed}) :
- impl = new {{interface|name}}ProxyImpl.fromEndpoint(
- endpoint, doListen: doListen, onClosed: onClosed) {
+ core.MojoMessagePipeEndpoint endpoint) :
+ impl = new {{interface|name}}ProxyImpl.fromEndpoint(endpoint) {
ptr = new _{{interface|name}}ProxyCalls(impl);
}
- {{interface|name}}Proxy.fromHandle(core.MojoHandle handle,
- {bool doListen: true, Function onClosed}) :
- impl = new {{interface|name}}ProxyImpl.fromHandle(
- handle, doListen: doListen, onClosed: onClosed) {
+ {{interface|name}}Proxy.fromHandle(core.MojoHandle handle) :
+ impl = new {{interface|name}}ProxyImpl.fromHandle(handle) {
ptr = new _{{interface|name}}ProxyCalls(impl);
}
@@ -163,35 +156,18 @@ class {{interface|name}}Proxy implements bindings.ProxyBase {
class {{interface|name}}Stub extends bindings.Stub {
{{interface|name}} _impl = null;
- {{interface|name}}Stub.fromEndpoint(core.MojoMessagePipeEndpoint endpoint,
- { {{interface|name}} impl, bool doListen: true, Function onClosed}) :
- super.fromEndpoint(endpoint, doListen: false) {
- assert(!doListen || (impl != null));
- if (impl != null) {
- this._impl = impl;
- }
- if (doListen) {
- listen(onClosed: onClosed);
- }
- }
+ {{interface|name}}Stub.fromEndpoint(
+ core.MojoMessagePipeEndpoint endpoint, [this._impl])
+ : super.fromEndpoint(endpoint);
- {{interface|name}}Stub.fromHandle(core.MojoHandle handle,
- { {{interface|name}} impl, bool doListen: true, Function onClosed}) :
- super.fromHandle(handle, doListen: false) {
- assert(!doListen || (impl != null));
- if (impl != null) {
- this._impl = impl;
- }
- if (doListen) {
- listen(onClosed: onClosed);
- }
- }
+ {{interface|name}}Stub.fromHandle(core.MojoHandle handle, [this._impl])
+ : super.fromHandle(handle);
{{interface|name}}Stub.unbound() : super.unbound();
static {{interface|name}}Stub newFromEndpoint(
core.MojoMessagePipeEndpoint endpoint) =>
- new {{interface|name}}Stub.fromEndpoint(endpoint, doListen: false);
+ new {{interface|name}}Stub.fromEndpoint(endpoint);
static const String name = {{interface|name}}Name;

Powered by Google App Engine
This is Rietveld 408576698