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

Unified Diff: runtime/vm/json_stream.cc

Issue 1799933002: Ensure embedder timeline callbacks are called for service protocol requests (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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/vm/json_stream.cc
diff --git a/runtime/vm/json_stream.cc b/runtime/vm/json_stream.cc
index a68d87d8553b56dfa0cd69cb70c75713ab62bbd0..a721c7e9bb0aaba4e33e5bec42dba5469bb5fe02 100644
--- a/runtime/vm/json_stream.cc
+++ b/runtime/vm/json_stream.cc
@@ -20,6 +20,23 @@ namespace dart {
#ifndef PRODUCT
+void AppendJSONStreamConsumer(Dart_StreamConsumer_State state,
+ const char* stream_name,
+ const uint8_t* buffer,
+ intptr_t buffer_length,
+ void* user_data) {
+ if ((state == Dart_StreamConsumer_kStart) ||
+ (state == Dart_StreamConsumer_kFinish)) {
+ // Ignore.
+ return;
+ }
+ ASSERT(state == Dart_StreamConsumer_kData);
+ JSONStream* js = reinterpret_cast<JSONStream*>(user_data);
+ ASSERT(js != NULL);
+ js->AppendSerializedObject(buffer, buffer_length);
+}
+
+
DECLARE_FLAG(bool, trace_service);
JSONStream::JSONStream(intptr_t buf_size)
@@ -263,6 +280,11 @@ void JSONStream::AppendSerializedObject(const char* serialized_object) {
}
+void JSONStream::AppendSerializedObject(const uint8_t* buffer,
+ intptr_t buffer_length) {
+ buffer_.AddRaw(buffer, buffer_length);
+}
+
void JSONStream::AppendSerializedObject(const char* property_name,
const char* serialized_object) {
PrintCommaIfNeeded();

Powered by Google App Engine
This is Rietveld 408576698