Chromium Code Reviews| Index: pkg/analysis_server/lib/src/channel.dart |
| diff --git a/pkg/analysis_server/lib/src/channel.dart b/pkg/analysis_server/lib/src/channel.dart |
| index 103c2b77acc39d9420ab98f31e89ac446fc8c9a2..9382eba7cf100e5bf43f2ed414f7b63232245ad8 100644 |
| --- a/pkg/analysis_server/lib/src/channel.dart |
| +++ b/pkg/analysis_server/lib/src/channel.dart |
| @@ -29,6 +29,11 @@ abstract class CommunicationChannel { |
| void sendNotification(Notification notification); |
| /** |
| + * Send the given [request] to the server. |
| + */ |
| + void sendRequest(Request request); |
| + |
| + /** |
| * Send the given [response] to the client. |
| */ |
| void sendResponse(Response response); |
| @@ -62,6 +67,12 @@ class WebSocketChannel implements CommunicationChannel { |
| } |
| @override |
| + void sendRequest(Request request) { |
| + JsonEncoder encoder = const JsonEncoder(null); |
|
Brian Wilkerson
2014/02/26 17:50:47
Should we create one instance that is re-used each
danrubel
2014/02/26 20:10:01
Good idea. Done.
|
| + socket.add(encoder.convert(request.toJson())); |
| + } |
| + |
| + @override |
| void sendResponse(Response response) { |
| JsonEncoder encoder = const JsonEncoder(null); |
| socket.add(encoder.convert(response.toJson())); |