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

Unified Diff: runtime/vm/service/client.dart

Issue 1077823003: Some cleanups in the code that posts results to service clients. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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 | « runtime/vm/service.cc ('k') | runtime/vm/service/constants.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/service/client.dart
diff --git a/runtime/vm/service/client.dart b/runtime/vm/service/client.dart
index 1fd4f44ad8be0fac5f27427c3b77254cbe73586a..0d0b253f0fa9de64cd2a23634590e0b2e65db152 100644
--- a/runtime/vm/service/client.dart
+++ b/runtime/vm/service/client.dart
@@ -6,20 +6,16 @@ part of vmservice;
// A service client.
abstract class Client {
- /// A port for receipt of asynchronous service events.
- final RawReceivePort eventPort = new RawReceivePort();
final VMService service;
+ final bool sendEvents;
- Client(this.service) {
- eventPort.handler = (response) {
- post(null, response);
- };
+ Client(this.service, { bool sendEvents: true })
+ : this.sendEvents = sendEvents {
service._addClient(this);
}
/// When implementing, call [close] when the network connection closes.
void close() {
- eventPort.close();
service._removeClient(this);
}
@@ -37,8 +33,8 @@ abstract class Client {
}
}
- /// When implementing, responsible for sending [response] to the client.
- void post(var seq, dynamic response);
+ // Sends a result to the client. Implemented in subclasses.
+ void post(var seq, dynamic result);
dynamic toJson() {
return {
« no previous file with comments | « runtime/vm/service.cc ('k') | runtime/vm/service/constants.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698