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

Unified Diff: pkg/analysis_server/lib/http_server.dart

Issue 725143004: Format and sort analyzer and analysis_server packages. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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 | « pkg/analysis_server/lib/driver.dart ('k') | pkg/analysis_server/lib/src/analysis_logger.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/http_server.dart
diff --git a/pkg/analysis_server/lib/http_server.dart b/pkg/analysis_server/lib/http_server.dart
index ef22a81cf47646e3de581c0eb3089a109bbe6030..4d8780fa952002d8a484a975856c97e40e0787c3 100644
--- a/pkg/analysis_server/lib/http_server.dart
+++ b/pkg/analysis_server/lib/http_server.dart
@@ -34,19 +34,55 @@ class HttpAnalysisServer {
GetHandler getHandler;
/**
+ * Future that is completed with the HTTP server once it is running.
+ */
+ Future<HttpServer> _server;
+
+ /**
+ * Last PRINT_BUFFER_LENGTH lines printed.
+ */
+ List<String> _printBuffer = <String>[];
+
+ /**
* Initialize a newly created HTTP server.
*/
HttpAnalysisServer(this.socketServer);
+ void close() {
+ _server.then((HttpServer server) {
+ server.close();
+ });
+ }
+
/**
- * Future that is completed with the HTTP server once it is running.
+ * Record that the given line was printed out by the analysis server.
*/
- Future<HttpServer> _server;
+ void recordPrint(String line) {
+ _printBuffer.add(line);
+ if (_printBuffer.length > MAX_PRINT_BUFFER_LENGTH) {
+ _printBuffer.removeRange(
+ 0,
+ _printBuffer.length - MAX_PRINT_BUFFER_LENGTH);
+ }
+ }
/**
- * Last PRINT_BUFFER_LENGTH lines printed.
+ * Begin serving HTTP requests over the given port.
*/
- List<String> _printBuffer = <String>[];
+ void serveHttp(int port) {
+ _server = HttpServer.bind(InternetAddress.LOOPBACK_IP_V4, port);
+ _server.then(_handleServer);
+ }
+
+ /**
+ * Handle a GET request received by the HTTP server.
+ */
+ void _handleGetRequest(HttpRequest request) {
+ if (getHandler == null) {
+ getHandler = new GetHandler(socketServer, _printBuffer);
+ }
+ getHandler.handleGetRequest(request);
+ }
/**
* Attach a listener to a newly created HTTP server.
@@ -67,16 +103,6 @@ class HttpAnalysisServer {
}
/**
- * Handle a GET request received by the HTTP server.
- */
- void _handleGetRequest(HttpRequest request) {
- if (getHandler == null) {
- getHandler = new GetHandler(socketServer, _printBuffer);
- }
- getHandler.handleGetRequest(request);
- }
-
- /**
* Handle an UPGRADE request received by the HTTP server by creating and
* running an analysis server on a [WebSocket]-based communication channel.
*/
@@ -95,29 +121,4 @@ class HttpAnalysisServer {
response.write('Not found');
response.close();
}
-
- /**
- * Begin serving HTTP requests over the given port.
- */
- void serveHttp(int port) {
- _server = HttpServer.bind(InternetAddress.LOOPBACK_IP_V4, port);
- _server.then(_handleServer);
- }
-
- void close() {
- _server.then((HttpServer server) {
- server.close();
- });
- }
-
- /**
- * Record that the given line was printed out by the analysis server.
- */
- void recordPrint(String line) {
- _printBuffer.add(line);
- if (_printBuffer.length > MAX_PRINT_BUFFER_LENGTH) {
- _printBuffer.removeRange(0,
- _printBuffer.length - MAX_PRINT_BUFFER_LENGTH);
- }
- }
}
« no previous file with comments | « pkg/analysis_server/lib/driver.dart ('k') | pkg/analysis_server/lib/src/analysis_logger.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698