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

Unified Diff: lib/src/isolate.dart

Issue 1670283002: add sendRequest to VMIsolateRef Base URL: git@github.com:yjbanov/vm_service_client.git@master
Patch Set: more semantic ArgumentError; test params Created 4 years, 10 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 | test/isolate_test.dart » ('j') | test/isolate_test.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
-}
+}
« no previous file with comments | « no previous file | test/isolate_test.dart » ('j') | test/isolate_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698