| Index: runtime/bin/vmservice/client/lib/src/app/application.dart
|
| diff --git a/runtime/bin/vmservice/client/lib/src/observatory/application.dart b/runtime/bin/vmservice/client/lib/src/app/application.dart
|
| similarity index 57%
|
| rename from runtime/bin/vmservice/client/lib/src/observatory/application.dart
|
| rename to runtime/bin/vmservice/client/lib/src/app/application.dart
|
| index 166189288b3eb4fb82ee3afcda17154d789e2619..0c2c05090bdd07ac3640341f6cd198d163e81a57 100644
|
| --- a/runtime/bin/vmservice/client/lib/src/observatory/application.dart
|
| +++ b/runtime/bin/vmservice/client/lib/src/app/application.dart
|
| @@ -2,52 +2,50 @@
|
| // for details. All rights reserved. Use of this source code is governed by a
|
| // BSD-style license that can be found in the LICENSE file.
|
|
|
| -part of observatory;
|
| +part of app;
|
| +
|
| +/// A request response interceptor is called for each response.
|
| +typedef void RequestResponseInterceptor();
|
|
|
| /// The observatory application. Instances of this are created and owned
|
| /// by the observatory_application custom element.
|
| class ObservatoryApplication extends Observable {
|
| @observable final LocationManager locationManager;
|
| - @observable final RequestManager requestManager;
|
| - @observable final IsolateManager isolateManager;
|
| + @observable final VM vm;
|
| + @observable Map response;
|
| + @observable Isolate isolate;
|
| +
|
| + void setResponse(Map response) {
|
| + this.response = toObservable(response);
|
| + }
|
| +
|
| + void setResponseError(String message, [String errorType = 'ResponseError']) {
|
| + this.response = toObservable({
|
| + 'type': 'Error',
|
| + 'errorType': errorType,
|
| + 'text': message
|
| + });
|
| + Logger.root.severe(message);
|
| + }
|
|
|
| void _setup() {
|
| - locationManager._application = this;
|
| - requestManager._application = this;
|
| - isolateManager._application = this;
|
| - Isolate._application = this;
|
| - requestManager.interceptor = isolateManager._responseInterceptor;
|
| + vm._app = this;
|
| + locationManager._app = this;
|
| locationManager.init();
|
| }
|
|
|
| ObservatoryApplication.devtools() :
|
| locationManager = new LocationManager(),
|
| - requestManager = new PostMessageRequestManager(),
|
| - isolateManager = new IsolateManager() {
|
| + vm = new DartiumVM() {
|
| _setup();
|
| }
|
|
|
| ObservatoryApplication() :
|
| locationManager = new LocationManager(),
|
| - requestManager = new HttpRequestManager(),
|
| - isolateManager = new IsolateManager() {
|
| + vm = new HttpVM('http://127.0.0.1:8181/') {
|
| _setup();
|
| }
|
|
|
| - /// Return the [Isolate] with [id].
|
| - Isolate getIsolate(int id) {
|
| - return isolateManager.isolates[id];
|
| - }
|
| -
|
| - /// Return the name of the isolate with [id].
|
| - String getIsolateName(int id) {
|
| - var isolate = getIsolate(id);
|
| - if (isolate == null) {
|
| - return 'Null Isolate';
|
| - }
|
| - return isolate.name;
|
| - }
|
| -
|
| static const int KB = 1024;
|
| static const int MB = KB * 1024;
|
| static String scaledSizeUnits(int x) {
|
|
|