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

Side by Side Diff: pkg/analysis_server/lib/src/channel.dart

Issue 139983004: Server code clean-up (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 library channel; 5 library channel;
6 6
7 import 'dart:async';
8 import 'dart:convert'; 7 import 'dart:convert';
9 import 'dart:io'; 8 import 'dart:io';
10 9
11 import 'protocol.dart'; 10 import 'package:analysis_server/src/protocol.dart';
12 11
13 /** 12 /**
14 * The abstract class [CommunicationChannel] defines the behavior of objects 13 * The abstract class [CommunicationChannel] defines the behavior of objects
15 * that allow an [AnalysisServer] to receive [Request]s and to return both 14 * that allow an [AnalysisServer] to receive [Request]s and to return both
16 * [Response]s and [Notification]s. 15 * [Response]s and [Notification]s.
17 */ 16 */
18 abstract class CommunicationChannel { 17 abstract class CommunicationChannel {
19 /** 18 /**
20 * Listen to the channel for requests. If a request is received, invoke the 19 * Listen to the channel for requests. If a request is received, invoke the
21 * [onRequest] function. If an error is encountered while trying to read from 20 * [onRequest] function. If an error is encountered while trying to read from
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 // structure as a request. 80 // structure as a request.
82 Request request = new Request.fromString(data); 81 Request request = new Request.fromString(data);
83 if (request == null) { 82 if (request == null) {
84 sendResponse(new Response.invalidRequestFormat()); 83 sendResponse(new Response.invalidRequestFormat());
85 return; 84 return;
86 } 85 }
87 onRequest(request); 86 onRequest(request);
88 } 87 }
89 } 88 }
90 } 89 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/analysis_server.dart ('k') | pkg/analysis_server/lib/src/domain_context.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698