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

Unified Diff: runtime/vm/service/message.dart

Issue 131973007: Allow root level requests in the vm service. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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 | « runtime/vm/service.cc ('k') | runtime/vm/service/vmservice.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/service/message.dart
===================================================================
--- runtime/vm/service/message.dart (revision 31848)
+++ runtime/vm/service/message.dart (working copy)
@@ -63,10 +63,27 @@
var keys = options.keys.toList();
var values = options.values.toList();
var request = [receivePort.sendPort, path, keys, values];
- sendServiceMessage(sendPort, request);
+ sendIsolateServiceMessage(sendPort, request);
return _completer.future;
}
+ Future<String> sendToVM() {
+ final receivePort = new RawReceivePort();
+ receivePort.handler = (value) {
+ receivePort.close();
+ if (value is Exception) {
+ _completer.completeError(value);
+ } else {
+ _completer.complete(value);
+ }
+ };
+ var keys = options.keys.toList();
+ var values = options.values.toList();
+ var request = [receivePort.sendPort, path, keys, values];
+ sendRootServiceMessage(request);
+ return _completer.future;
+ }
+
void setResponse(String response) {
_completer.complete(response);
}
@@ -80,3 +97,9 @@
}));
}
}
+
+void sendIsolateServiceMessage(SendPort sp, List m)
+ native "VMService_SendIsolateServiceMessage";
+
+void sendRootServiceMessage(List m)
+ native "VMService_SendRootServiceMessage";
« no previous file with comments | « runtime/vm/service.cc ('k') | runtime/vm/service/vmservice.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698