| Index: runtime/bin/vmservice/client/observatory/packages/observatory/src/observatory/application.dart
|
| diff --git a/runtime/bin/vmservice/client/observatory/packages/observatory/src/observatory/application.dart b/runtime/bin/vmservice/client/observatory/packages/observatory/src/observatory/application.dart
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..f573f4cf28105b05dedd88783196c4a7108eb1e2
|
| --- /dev/null
|
| +++ b/runtime/bin/vmservice/client/observatory/packages/observatory/src/observatory/application.dart
|
| @@ -0,0 +1,40 @@
|
| +part of observatory;
|
| +
|
| +class ObservatoryApplication {
|
| + final Anchor anchor = new Anchor();
|
| + final RequestManager requestManager = new HttpRequestManager();
|
| + final IsolateManager isolateManager = new IsolateManager();
|
| +
|
| + ObservatoryApplication() {
|
| + anchor._application = this;
|
| + requestManager._application = this;
|
| + isolateManager._application = this;
|
| + }
|
| +
|
| + void requestInterceptor() {
|
| + requestManager.responses.forEach((response) {
|
| + if (response['type'] == 'IsolateList') {
|
| + isolateManager._updateIsolates(response['members']);
|
| + }
|
| + });
|
| + }
|
| +
|
| + Isolate getIsolate(int id) {
|
| + return isolateManager.isolates[id];
|
| + }
|
| +
|
| + String getIsolateName(int id) {
|
| + var isolate = getIsolate(id);
|
| + if (isolate == null) {
|
| + return 'Null Isolate';
|
| + }
|
| + return isolate.name;
|
| + }
|
| +
|
| + void init() {
|
| + requestManager.interceptor = requestInterceptor;
|
| + requestManager.prefix = 'http://127.0.0.1:8181';
|
| + anchor.init();
|
| + print('Initialized.');
|
| + }
|
| +}
|
|
|