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

Side by Side Diff: runtime/bin/vmservice/server.dart

Issue 2829463003: Format all remaining unformatted runtime files other than multitests. (Closed)
Patch Set: Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 part of vmservice_io; 5 part of vmservice_io;
6 6
7 final bool silentObservatory = const bool.fromEnvironment('SILENT_OBSERVATORY'); 7 final bool silentObservatory = const bool.fromEnvironment('SILENT_OBSERVATORY');
8 8
9 void serverPrint(String s) { 9 void serverPrint(String s) {
10 if (silentObservatory) { 10 if (silentObservatory) {
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 } 354 }
355 355
356 // poll for the network for ~10 seconds. 356 // poll for the network for ~10 seconds.
357 int attempts = 0; 357 int attempts = 0;
358 final int maxAttempts = 10; 358 final int maxAttempts = 10;
359 while (!await poll()) { 359 while (!await poll()) {
360 attempts++; 360 attempts++;
361 serverPrint("Observatory server failed to start after $attempts tries"); 361 serverPrint("Observatory server failed to start after $attempts tries");
362 if (attempts > maxAttempts) { 362 if (attempts > maxAttempts) {
363 serverPrint('Could not start Observatory HTTP server:\n' 363 serverPrint('Could not start Observatory HTTP server:\n'
364 '$pollError\n$pollStack\n'); 364 '$pollError\n$pollStack\n');
365 _notifyServerState(""); 365 _notifyServerState("");
366 onServerAddressChange(null); 366 onServerAddressChange(null);
367 return this; 367 return this;
368 } 368 }
369 await new Future<Null>.delayed(const Duration(seconds: 1)); 369 await new Future<Null>.delayed(const Duration(seconds: 1));
370 } 370 }
371 _server.listen(_requestHandler, cancelOnError: true); 371 _server.listen(_requestHandler, cancelOnError: true);
372 serverPrint('Observatory listening on $serverAddress'); 372 serverPrint('Observatory listening on $serverAddress');
373 if (Platform.isFuchsia) { 373 if (Platform.isFuchsia) {
374 // Create a file with the port number. 374 // Create a file with the port number.
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 _server = null; 415 _server = null;
416 serverPrint('Could not shutdown Observatory HTTP server:\n$e\n$st\n'); 416 serverPrint('Could not shutdown Observatory HTTP server:\n$e\n$st\n');
417 _notifyServerState(""); 417 _notifyServerState("");
418 onServerAddressChange(null); 418 onServerAddressChange(null);
419 return this; 419 return this;
420 }); 420 });
421 } 421 }
422 } 422 }
423 423
424 void _notifyServerState(String uri) native "VMServiceIO_NotifyServerState"; 424 void _notifyServerState(String uri) native "VMServiceIO_NotifyServerState";
OLDNEW
« no previous file with comments | « runtime/bin/vmservice/loader.dart ('k') | runtime/observatory/lib/src/elements/allocation_profile.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698