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

Unified Diff: runtime/observatory/lib/src/service/object.dart

Issue 895943002: Support root-level json rpc requests in the vm service. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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
« no previous file with comments | « no previous file | runtime/vm/service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/observatory/lib/src/service/object.dart
diff --git a/runtime/observatory/lib/src/service/object.dart b/runtime/observatory/lib/src/service/object.dart
index e2030a217ccdef35e723205abcdc79b07b28ff25..234e281dc3ae95f56e39a32721aa5897062772f2 100644
--- a/runtime/observatory/lib/src/service/object.dart
+++ b/runtime/observatory/lib/src/service/object.dart
@@ -211,6 +211,13 @@ abstract class ServiceObject extends Observable {
Future<ServiceObject> _inProgressReload;
+ Future<ObservableMap> _fetchDirect() {
+ Map params = {
+ 'objectId': id,
+ };
+ return isolate.invokeRpcNoUpgrade('getObject', params);
+ }
+
/// Reload [this]. Returns a future which completes to [this] or
/// a [ServiceError].
Future<ServiceObject> reload() {
@@ -223,7 +230,7 @@ abstract class ServiceObject extends Observable {
return new Future.value(this);
}
if (_inProgressReload == null) {
- _inProgressReload = vm.getAsMap(link).then((ObservableMap map) {
+ _inProgressReload = _fetchDirect().then((ObservableMap map) {
var mapType = _stripRef(map['type']);
if (mapType != _type) {
// If the type changes, return a new object instead of
@@ -589,6 +596,10 @@ abstract class VM extends ServiceObjectOwner {
});
}
+ Future<ObservableMap> _fetchDirect() {
+ return invokeRpcNoUpgrade('getVM', {});
+ }
+
/// Force the VM to disconnect.
void disconnect();
/// Completes when the VM first connects.
@@ -909,7 +920,6 @@ class Isolate extends ServiceObjectOwner with Coverage {
return vm.invokeRpcNoUpgrade(method, params);
}
-
Future<ServiceObject> invokeRpc(String method, Map params) {
return invokeRpcNoUpgrade(method, params).then((ObservableMap response) {
// TODO - needs to cache!!! move to constructor?
@@ -917,6 +927,10 @@ class Isolate extends ServiceObjectOwner with Coverage {
});
}
+ Future<ObservableMap> _fetchDirect() {
+ return invokeRpcNoUpgrade('getIsolate', {});
+ }
+
@observable Class objectClass;
@observable final rootClasses = new ObservableList<Class>();
@@ -2797,6 +2811,12 @@ class ServiceMetric extends ServiceObject {
_removeOld();
}
+ Future<ObservableMap> _fetchDirect() {
+ // TODO(johnmmccutchan): Make this use json rpc.
+ return vm.getAsMap(link);
+ }
+
+
void addSample(MetricSample sample) {
samples.add(sample);
_removeOld();
« no previous file with comments | « no previous file | runtime/vm/service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698