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

Unified Diff: runtime/vm/service.h

Issue 1232193003: Provide stdout and stderr output in the Observatory debugger. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: before commit Created 5 years, 5 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/isolate.cc ('k') | runtime/vm/service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/service.h
diff --git a/runtime/vm/service.h b/runtime/vm/service.h
index 85c607f309c1194a7da7488d709b6977fd67edd2..9e25340389b6941a1fc7fe9787163c4024211274 100644
--- a/runtime/vm/service.h
+++ b/runtime/vm/service.h
@@ -59,6 +59,21 @@ class RingServiceIdZone : public ServiceIdZone {
};
+class StreamInfo {
+ public:
+ explicit StreamInfo(const char* id) : id_(id), enabled_(false) {}
+
+ const char* id() { return id_; }
+
+ void set_enabled(bool value) { enabled_ = value; }
+ bool enabled() { return enabled_; }
+
+ private:
+ const char* id_;
+ bool enabled_;
+};
+
+
class Service : public AllStatic {
public:
// Handles a message which is not directed to an isolate.
@@ -67,15 +82,6 @@ class Service : public AllStatic {
// Handles a message which is directed to a particular isolate.
static void HandleIsolateMessage(Isolate* isolate, const Array& message);
- static bool NeedsIsolateEvents() { return needs_isolate_events_; }
- static bool NeedsDebugEvents() { return needs_debug_events_; }
- static bool NeedsGCEvents() { return needs_gc_events_; }
- static bool NeedsEchoEvents() { return needs_echo_events_; }
- static bool NeedsGraphEvents() { return needs_graph_events_; }
-
- static void ListenStream(const char* stream_id);
- static void CancelStream(const char* stream_id);
-
static void HandleEvent(ServiceEvent* event);
static void RegisterIsolateEmbedderCallback(
@@ -88,10 +94,37 @@ class Service : public AllStatic {
Dart_ServiceRequestCallback callback,
void* user_data);
+ static void SetEmbedderStreamCallbacks(
+ Dart_ServiceStreamListenCallback listen_callback,
+ Dart_ServiceStreamCancelCallback cancel_callback);
+
static void SendEchoEvent(Isolate* isolate, const char* text);
static void SendGraphEvent(Isolate* isolate);
static void SendInspectEvent(Isolate* isolate, const Object& inspectee);
+ static void SendEmbedderEvent(Isolate* isolate,
+ const char* stream_id,
+ const char* event_kind,
+ const uint8_t* bytes,
+ intptr_t bytes_len);
+
+ // Well-known streams.
+ static StreamInfo isolate_stream;
+ static StreamInfo debug_stream;
+ static StreamInfo gc_stream;
+ static StreamInfo echo_stream;
+ static StreamInfo graph_stream;
+
+ static bool ListenStream(const char* stream_id);
+ static void CancelStream(const char* stream_id);
+
+ static Dart_ServiceStreamListenCallback stream_listen_callback() {
+ return stream_listen_callback_;
+ }
+ static Dart_ServiceStreamCancelCallback stream_cancel_callback() {
+ return stream_cancel_callback_;
+ }
+
private:
static void InvokeMethod(Isolate* isolate, const Array& message);
@@ -113,6 +146,8 @@ class Service : public AllStatic {
static EmbedderServiceHandler* isolate_service_handler_head_;
static EmbedderServiceHandler* root_service_handler_head_;
+ static Dart_ServiceStreamListenCallback stream_listen_callback_;
+ static Dart_ServiceStreamCancelCallback stream_cancel_callback_;
static bool needs_isolate_events_;
static bool needs_debug_events_;
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698