| OLD | NEW |
| 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 observatory; | 5 part of observatory; |
| 6 | 6 |
| 7 /// The observatory application. Instances of this are created and owned | 7 /// The observatory application. Instances of this are created and owned |
| 8 /// by the observatory_application custom element. | 8 /// by the observatory_application custom element. |
| 9 class ObservatoryApplication extends Observable { | 9 class ObservatoryApplication extends Observable { |
| 10 @observable final LocationManager locationManager; | 10 @observable final LocationManager locationManager; |
| 11 @observable final RequestManager requestManager; | 11 @observable final RequestManager requestManager; |
| 12 @observable final IsolateManager isolateManager; | 12 @observable final IsolateManager isolateManager; |
| 13 | 13 |
| 14 ObservatoryApplication() : | 14 void _setup() { |
| 15 locationManager = new LocationManager(), | |
| 16 requestManager = new HttpRequestManager(), | |
| 17 isolateManager = new IsolateManager() { | |
| 18 locationManager._application = this; | 15 locationManager._application = this; |
| 19 requestManager._application = this; | 16 requestManager._application = this; |
| 20 isolateManager._application = this; | 17 isolateManager._application = this; |
| 21 requestManager.interceptor = isolateManager._responseInterceptor; | 18 requestManager.interceptor = isolateManager._responseInterceptor; |
| 22 locationManager.init(); | 19 locationManager.init(); |
| 23 } | 20 } |
| 24 | 21 |
| 22 ObservatoryApplication.devtools() : |
| 23 locationManager = new LocationManager(), |
| 24 requestManager = new PostMessageRequestManager(), |
| 25 isolateManager = new IsolateManager() { |
| 26 _setup(); |
| 27 } |
| 28 |
| 29 ObservatoryApplication() : |
| 30 locationManager = new LocationManager(), |
| 31 requestManager = new HttpRequestManager(), |
| 32 isolateManager = new IsolateManager() { |
| 33 _setup(); |
| 34 } |
| 35 |
| 25 /// Return the [Isolate] with [id]. | 36 /// Return the [Isolate] with [id]. |
| 26 Isolate getIsolate(int id) { | 37 Isolate getIsolate(int id) { |
| 27 return isolateManager.isolates[id]; | 38 return isolateManager.isolates[id]; |
| 28 } | 39 } |
| 29 | 40 |
| 30 /// Return the name of the isolate with [id]. | 41 /// Return the name of the isolate with [id]. |
| 31 String getIsolateName(int id) { | 42 String getIsolateName(int id) { |
| 32 var isolate = getIsolate(id); | 43 var isolate = getIsolate(id); |
| 33 if (isolate == null) { | 44 if (isolate == null) { |
| 34 return 'Null Isolate'; | 45 return 'Null Isolate'; |
| 35 } | 46 } |
| 36 return isolate.name; | 47 return isolate.name; |
| 37 } | 48 } |
| 38 } | 49 } |
| OLD | NEW |