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

Unified Diff: runtime/vm/service_event.cc

Issue 1537523002: Add dart:developer.postEvent for posting events to the service protocol from Dart code (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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.h ('k') | sdk/lib/developer/extension.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/service_event.cc
diff --git a/runtime/vm/service_event.cc b/runtime/vm/service_event.cc
index 280efc08d458d9ba706167dfe5d4f2009c92c9a7..92b6f43bd92d3f895b53ebe5054e8014b32be786 100644
--- a/runtime/vm/service_event.cc
+++ b/runtime/vm/service_event.cc
@@ -135,6 +135,8 @@ const char* ServiceEvent::KindAsCString() const {
return "_DebuggerSettingsUpdate";
case kIllegal:
return "Illegal";
+ case kExtension:
+ return "Extension";
default:
UNREACHABLE();
return "Unknown";
@@ -176,6 +178,9 @@ const char* ServiceEvent::stream_id() const {
case kLogging:
return Service::logging_stream.id();
+ case kExtension:
+ return Service::extension_stream.id();
+
default:
UNREACHABLE();
return NULL;
@@ -241,6 +246,10 @@ void ServiceEvent::PrintJSON(JSONStream* js) const {
logRecord.AddProperty("error", *(log_record_.error));
logRecord.AddProperty("stackTrace", *(log_record_.stack_trace));
}
+ if (kind() == kExtension) {
+ js->AppendSerializedObject("extensionData",
+ extension_event_.event_data->ToCString());
+ }
}
@@ -248,6 +257,11 @@ void ServiceEvent::PrintJSONHeader(JSONObject* jsobj) const {
ASSERT(jsobj != NULL);
jsobj->AddProperty("type", "Event");
jsobj->AddProperty("kind", KindAsCString());
+ if (kind() == kExtension) {
+ ASSERT(extension_event_.event_kind != NULL);
+ jsobj->AddProperty("extensionKind",
+ extension_event_.event_kind->ToCString());
+ }
if (kind() == kVMUpdate) {
jsobj->AddPropertyVM("vm");
} else {
« no previous file with comments | « runtime/vm/service_event.h ('k') | sdk/lib/developer/extension.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698