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

Unified Diff: runtime/vm/service_isolate.cc

Issue 1166433008: 2nd attempt at adding streamListen/streamCancel to the service protocol. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: fix context objects Created 5 years, 6 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_event.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/service_isolate.cc
diff --git a/runtime/vm/service_isolate.cc b/runtime/vm/service_isolate.cc
index faffd6676f08f1195e8f7ee28393125403460502..9ff38ef9cc19714c08278a4c450ce213aee49e17 100644
--- a/runtime/vm/service_isolate.cc
+++ b/runtime/vm/service_isolate.cc
@@ -296,6 +296,26 @@ class ServiceIsolateNatives : public AllStatic {
}
}
}
+
+ static void ListenStream(Dart_NativeArguments args) {
+ NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args);
+ Isolate* isolate = arguments->thread()->isolate();
+ StackZone stack_zone(isolate);
+ Zone* zone = stack_zone.GetZone(); // Used by GET_NON_NULL_NATIVE_ARGUMENT.
+ HANDLESCOPE(isolate);
+ GET_NON_NULL_NATIVE_ARGUMENT(String, stream_id, arguments->NativeArgAt(0));
+ Service::ListenStream(stream_id.ToCString());
+ }
+
+ static void CancelStream(Dart_NativeArguments args) {
+ NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args);
+ Isolate* isolate = arguments->thread()->isolate();
+ StackZone stack_zone(isolate);
+ Zone* zone = stack_zone.GetZone(); // Used by GET_NON_NULL_NATIVE_ARGUMENT.
+ HANDLESCOPE(isolate);
+ GET_NON_NULL_NATIVE_ARGUMENT(String, stream_id, arguments->NativeArgAt(0));
+ Service::CancelStream(stream_id.ToCString());
+ }
};
@@ -315,6 +335,10 @@ static ServiceNativeEntry _ServiceNativeEntries[] = {
ServiceIsolateNatives::OnStart },
{"VMService_OnExit", 0,
ServiceIsolateNatives::OnExit },
+ {"VMService_ListenStream", 1,
+ ServiceIsolateNatives::ListenStream },
+ {"VMService_CancelStream", 1,
+ ServiceIsolateNatives::CancelStream },
};
« no previous file with comments | « runtime/vm/service_event.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698