Index: lib/src/isolate.dart |
diff --git a/lib/src/isolate.dart b/lib/src/isolate.dart |
index d9363daa37947af26664dde7e475026e8286fba8..d2f876c9966fc1cdc01ca643edd598b788d23250 100644 |
--- a/lib/src/isolate.dart |
+++ b/lib/src/isolate.dart |
@@ -264,6 +264,22 @@ class VMIsolateRef { |
} |
} |
+ /// Makes a raw RPC to a VM service extension registered in the isolate |
+ /// corresponding to the ID [number]. |
+ /// |
+ /// [method] must correspond to a VM service extension installed on the VM |
+ /// isolate and it must begin with prefix "ext.". |
+ /// |
+ /// [params] are passed to the extension handler and must be serializable to |
+ /// a JSON string. |
+ Future<Map> invokeExtension(String method, [Map<String, Object> params]) { |
+ if (!method.startsWith('ext.')) { |
+ throw new ArgumentError.value(method, 'method', |
+ 'must begin with "ext." prefix'); |
+ } |
+ return _scope.sendRequest(method, params); |
+ } |
+ |
bool operator ==(other) => other is VMIsolateRef && |
other._scope.isolateId == _scope.isolateId; |
@@ -365,4 +381,4 @@ class VMStep { |
const VMStep._(this._value); |
String toString() => _value; |
-} |
+} |