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

Side by Side Diff: benchmarks/mojo_rtt_benchmark/lib/echo_server.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 unified diff | Download patch
« no previous file with comments | « no previous file | mojo/dart/apptests/test_apps/echo/lib/main.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 import 'dart:async'; 5 import 'dart:async';
6 6
7 import 'package:mojo/application.dart'; 7 import 'package:mojo/application.dart';
8 import 'package:mojo/bindings.dart'; 8 import 'package:mojo/bindings.dart';
9 import 'package:mojo/core.dart'; 9 import 'package:mojo/core.dart';
10 import 'package:_mojo_for_test_only/mojo/examples/echo.mojom.dart'; 10 import 'package:_mojo_for_test_only/mojo/examples/echo.mojom.dart';
11 11
12 class EchoImpl implements Echo { 12 class EchoImpl implements Echo {
13 EchoStub _stub; 13 EchoStub _stub;
14 EchoApplication _application; 14 EchoApplication _application;
15 15
16 EchoImpl(this._application, MojoMessagePipeEndpoint endpoint) { 16 EchoImpl(this._application, MojoMessagePipeEndpoint endpoint) {
17 _stub = new EchoStub.fromEndpoint(endpoint, this); 17 _stub = new EchoStub.fromEndpoint(endpoint, this);
18 _stub.onError = _errorHandler; 18 _stub.ctrl.onError = _errorHandler;
19 } 19 }
20 20
21 echoString(String value, [Function responseFactory]) => 21 echoString(String value, [Function responseFactory]) =>
22 responseFactory(value); 22 responseFactory(value);
23 23
24 Future close() => _stub.close(); 24 Future close() => _stub.close();
25 25
26 _errorHandler(Object e) => _application.removeService(this); 26 _errorHandler(Object e) => _application.removeService(this);
27 } 27 }
28 28
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 await service.close(); 65 await service.close();
66 } 66 }
67 MojoHandle.reportLeakedHandles(); 67 MojoHandle.reportLeakedHandles();
68 } 68 }
69 } 69 }
70 70
71 main(List args, Object handleToken) { 71 main(List args, Object handleToken) {
72 MojoHandle appHandle = new MojoHandle(handleToken); 72 MojoHandle appHandle = new MojoHandle(handleToken);
73 new EchoApplication.fromHandle(appHandle); 73 new EchoApplication.fromHandle(appHandle);
74 } 74 }
OLDNEW
« no previous file with comments | « no previous file | mojo/dart/apptests/test_apps/echo/lib/main.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698