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

Unified Diff: runtime/bin/vmservice_impl.cc

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
Index: runtime/bin/vmservice_impl.cc
===================================================================
--- runtime/bin/vmservice_impl.cc (revision 31674)
+++ runtime/bin/vmservice_impl.cc (working copy)
@@ -20,6 +20,7 @@
#include "vm/native_arguments.h"
#include "vm/object.h"
#include "vm/port.h"
+#include "vm/service.h"
#include "vm/snapshot.h"
namespace dart {
@@ -486,7 +487,7 @@
}
-static void SendServiceMessage(Dart_NativeArguments args) {
+static void SendIsolateServiceMessage(Dart_NativeArguments args) {
NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args);
Isolate* isolate = arguments->isolate();
StackZone zone(isolate);
@@ -499,7 +500,7 @@
if (sp_id_obj.IsError()) {
Exceptions::PropagateError(Error::Cast(sp_id_obj));
}
- Integer& id = Integer::Handle();
+ Integer& id = Integer::Handle(isolate);
id ^= sp_id_obj.raw();
Dart_Port sp_id = static_cast<Dart_Port>(id.AsInt64Value());
ASSERT(sp_id != ILLEGAL_PORT);
@@ -515,6 +516,16 @@
}
+static void SendRootServiceMessage(Dart_NativeArguments args) {
+ NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args);
+ Isolate* isolate = arguments->isolate();
+ StackZone zone(isolate);
+ HANDLESCOPE(isolate);
+ GET_NON_NULL_NATIVE_ARGUMENT(Instance, message, arguments->NativeArgAt(0));
+ Service::HandleRootMessage(message);
+}
+
+
struct VmServiceNativeEntry {
const char* name;
int num_arguments;
@@ -523,7 +534,8 @@
static VmServiceNativeEntry _VmServiceNativeEntries[] = {
- {"VMService_SendServiceMessage", 2, SendServiceMessage}
+ {"VMService_SendServiceMessage", 2, SendIsolateServiceMessage},
+ {"VMService_SendRootServiceMessage", 1, SendRootServiceMessage}
};

Powered by Google App Engine
This is Rietveld 408576698