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

Side by Side Diff: runtime/bin/vmservice/message.dart

Issue 93873015: - Remove the reply_port from the VM internal message object. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/bin/vmservice/vmservice.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 (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of vmservice; 5 part of vmservice;
6 6
7 class Message { 7 class Message {
8 final Completer _completer = new Completer.sync(); 8 final Completer _completer = new Completer.sync();
9 bool get completed => _completer.isCompleted; 9 bool get completed => _completer.isCompleted;
10 /// Future of response. 10 /// Future of response.
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 receivePort.handler = (value) { 55 receivePort.handler = (value) {
56 receivePort.close(); 56 receivePort.close();
57 if (value is Exception) { 57 if (value is Exception) {
58 _completer.completeError(value); 58 _completer.completeError(value);
59 } else { 59 } else {
60 _completer.complete(value); 60 _completer.complete(value);
61 } 61 }
62 }; 62 };
63 var keys = options.keys.toList(); 63 var keys = options.keys.toList();
64 var values = options.values.toList(); 64 var values = options.values.toList();
65 var request = [path, keys, values]; 65 var request = [receivePort.sendPort, path, keys, values];
66 sendServiceMessage(sendPort, receivePort, request); 66 sendServiceMessage(sendPort, request);
67 return _completer.future; 67 return _completer.future;
68 } 68 }
69 69
70 void setResponse(String response) { 70 void setResponse(String response) {
71 _completer.complete(response); 71 _completer.complete(response);
72 } 72 }
73 73
74 void setErrorResponse(String error) { 74 void setErrorResponse(String error) {
75 _completer.complete(JSON.encode({ 75 _completer.complete(JSON.encode({
76 'type': 'Error', 76 'type': 'Error',
77 'msg': error, 77 'msg': error,
78 'path': path, 78 'path': path,
79 'options': options 79 'options': options
80 })); 80 }));
81 } 81 }
82 } 82 }
OLDNEW
« no previous file with comments | « no previous file | runtime/bin/vmservice/vmservice.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698