Index: runtime/vm/service.cc |
diff --git a/runtime/vm/service.cc b/runtime/vm/service.cc |
index c698ffb8238b9e139c3b87a2297d98c6b5a7822b..c8c42499159649e8ab8167b06b30b9d12934fea4 100644 |
--- a/runtime/vm/service.cc |
+++ b/runtime/vm/service.cc |
@@ -113,6 +113,7 @@ StreamInfo Service::gc_stream("GC"); |
StreamInfo Service::echo_stream("_Echo"); |
StreamInfo Service::graph_stream("_Graph"); |
StreamInfo Service::logging_stream("_Logging"); |
+StreamInfo Service::extension_stream("Extension"); |
static StreamInfo* streams_[] = { |
&Service::vm_stream, |
@@ -122,6 +123,7 @@ static StreamInfo* streams_[] = { |
&Service::echo_stream, |
&Service::graph_stream, |
&Service::logging_stream, |
+ &Service::extension_stream, |
}; |
@@ -2952,6 +2954,9 @@ void Service::SendLogEvent(Isolate* isolate, |
const Instance& zone, |
const Object& error, |
const Instance& stack_trace) { |
+ if (!Service::logging_stream.enabled()) { |
+ return; |
+ } |
ServiceEvent::LogRecord log_record; |
log_record.sequence_number = sequence_number; |
log_record.timestamp = timestamp; |
@@ -2967,6 +2972,21 @@ void Service::SendLogEvent(Isolate* isolate, |
} |
+void Service::SendExtensionEvent(Isolate* isolate, |
+ const String& event_kind, |
+ const String& event_data) { |
+ if (!Service::extension_stream.enabled()) { |
+ return; |
+ } |
+ ServiceEvent::ExtensionEvent extension_event; |
+ extension_event.event_kind = &event_kind; |
+ extension_event.event_data = &event_data; |
+ ServiceEvent event(isolate, ServiceEvent::kExtension); |
+ event.set_extension_event(extension_event); |
+ Service::HandleEvent(&event); |
+} |
+ |
+ |
class ContainsAddressVisitor : public FindObjectVisitor { |
public: |
ContainsAddressVisitor(Isolate* isolate, uword addr) |