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 ObservatoryApplication() : |
15 locationManager = new LocationManager(), | 15 locationManager = new LocationManager(), |
16 requestManager = new HttpRequestManager(), | 16 requestManager = new HttpRequestManager(), |
17 isolateManager = new IsolateManager() { | 17 isolateManager = new IsolateManager() { |
18 locationManager._application = this; | 18 locationManager._application = this; |
19 requestManager._application = this; | 19 requestManager._application = this; |
20 isolateManager._application = this; | 20 isolateManager._application = this; |
21 requestManager.interceptor = isolateManager._responseInterceptor; | 21 requestManager.interceptor = isolateManager._responseInterceptor; |
22 locationManager.init(); | 22 locationManager.init(); |
23 } | 23 } |
24 | 24 |
25 /// Return the [Isolate] with [id]. | 25 /// Return the [Isolate] with [id]. |
26 Isolate getIsolate(int id) { | 26 Isolate getIsolate(int id) { |
27 return isolateManager.isolates[id]; | 27 return isolateManager.isolates[id]; |
28 } | 28 } |
29 | 29 |
30 | |
Ivan Posva
2013/11/22 22:38:12
?
turnidge
2013/11/22 22:49:58
Done.
turnidge
2013/11/22 22:49:58
Done.
| |
30 /// Return the name of the isolate with [id]. | 31 /// Return the name of the isolate with [id]. |
31 String getIsolateName(int id) { | 32 String getIsolateName(int id) { |
32 var isolate = getIsolate(id); | 33 var isolate = getIsolate(id); |
33 if (isolate == null) { | 34 if (isolate == null) { |
34 return 'Null Isolate'; | 35 return 'Null Isolate'; |
35 } | 36 } |
36 return isolate.name; | 37 return isolate.name; |
37 } | 38 } |
38 } | 39 } |
OLD | NEW |