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

Unified Diff: runtime/bin/vmservice/client/lib/src/service/object.dart

Issue 335463008: Allow Observatory to run as a hosted web service (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: runtime/bin/vmservice/client/lib/src/service/object.dart
diff --git a/runtime/bin/vmservice/client/lib/src/service/object.dart b/runtime/bin/vmservice/client/lib/src/service/object.dart
index 6ab70cef7f799bb4dc0e9edf1cc50c896f45bb9f..ec12cc2bcfa904e209de89a8401a00acefbfd8b4 100644
--- a/runtime/bin/vmservice/client/lib/src/service/object.dart
+++ b/runtime/bin/vmservice/client/lib/src/service/object.dart
@@ -377,13 +377,7 @@ abstract class VM extends ServiceObjectOwner {
/// will only receive a map encoding a valid ServiceObject.
Future<ObservableMap> getAsMap(String id) {
return getString(id).then((response) {
- var map;
- try {
- map = _parseJSON(response);
- } catch (e, st) {
- print('Hit V8 bug.');
- return _decodeError(e);
- }
+ var map = _parseJSON(response);
return _processMap(map);
}).catchError((error) {
// ServiceError, forward to VM's ServiceError stream.
@@ -398,6 +392,12 @@ abstract class VM extends ServiceObjectOwner {
/// Get [id] as a [String] from the service directly. See [getAsMap].
Future<String> getString(String id);
+ /// Force the VM to disconnect.
+ void disconnect();
+ /// Completes when the VM first connects.
+ Future get onConnect;
+ /// Completes when the VM disconnects or there was an error connecting.
+ Future get onDisconnect;
void _update(ObservableMap map, bool mapIsRef) {
if (mapIsRef) {
@@ -669,12 +669,12 @@ class Isolate extends ServiceObjectOwner with Coverage {
}
// Cache miss. Get the object from the vm directly.
return vm.getAsMap(relativeLink(id)).then((ObservableMap map) {
- var obj = new ServiceObject._fromMap(this, map);
- if (obj.canCache) {
- _cache.putIfAbsent(id, () => obj);
- }
- return obj;
- });
+ var obj = new ServiceObject._fromMap(this, map);
+ if (obj.canCache) {
+ _cache.putIfAbsent(id, () => obj);
+ }
+ return obj;
+ });
}
@observable Class objectClass;

Powered by Google App Engine
This is Rietveld 408576698