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

Side by Side Diff: pkg/analysis_server/lib/driver.dart

Issue 814453003: Ensure shutdown is always called (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | pkg/analysis_server/lib/src/analysis_server.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) 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 driver; 5 library driver;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:io'; 8 import 'dart:io';
9 9
10 import 'package:analysis_server/http_server.dart'; 10 import 'package:analysis_server/http_server.dart';
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 227
228 if (serve_http) { 228 if (serve_http) {
229 httpServer.serveHttp(port); 229 httpServer.serveHttp(port);
230 } 230 }
231 231
232 if (results[INTERNAL_PRINT_TO_CONSOLE]) { 232 if (results[INTERNAL_PRINT_TO_CONSOLE]) {
233 stdioServer.serveStdio().then((_) { 233 stdioServer.serveStdio().then((_) {
234 if (serve_http) { 234 if (serve_http) {
235 httpServer.close(); 235 httpServer.close();
236 } 236 }
237 service.shutdown();
237 exit(0); 238 exit(0);
238 }); 239 });
239 } else { 240 } else {
240 _capturePrints(() { 241 _capturePrints(() {
241 stdioServer.serveStdio().then((_) { 242 stdioServer.serveStdio().then((_) {
242 if (serve_http) { 243 if (serve_http) {
243 httpServer.close(); 244 httpServer.close();
244 } 245 }
246 service.shutdown();
245 exit(0); 247 exit(0);
246 }); 248 });
247 }, httpServer.recordPrint); 249 }, httpServer.recordPrint);
248 } 250 }
249 } 251 }
250 252
251 /** 253 /**
252 * Execute [callback], capturing any data it prints out and redirecting it to 254 * Execute [callback], capturing any data it prints out and redirecting it to
253 * the function [printHandler]. 255 * the function [printHandler].
254 */ 256 */
(...skipping 10 matching lines...) Expand all
265 /** 267 /**
266 * Print information about how to use the server. 268 * Print information about how to use the server.
267 */ 269 */
268 void _printUsage(ArgParser parser) { 270 void _printUsage(ArgParser parser) {
269 print('Usage: $BINARY_NAME [flags]'); 271 print('Usage: $BINARY_NAME [flags]');
270 print(''); 272 print('');
271 print('Supported flags are:'); 273 print('Supported flags are:');
272 print(parser.usage); 274 print(parser.usage);
273 } 275 }
274 } 276 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/analysis_server.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698