Flutter Engine
The Flutter Engine
json_stream.h
Go to the documentation of this file.
1// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2// for details. All rights reserved. Use of this source code is governed by a
3// BSD-style license that can be found in the LICENSE file.
4
5#ifndef RUNTIME_VM_JSON_STREAM_H_
6#define RUNTIME_VM_JSON_STREAM_H_
7
8#include "include/dart_api.h" // for Dart_Port
11#include "vm/json_writer.h"
12#include "vm/os.h"
13#include "vm/service.h"
14#include "vm/token_position.h"
15
16namespace dart {
17
18class Array;
19class Breakpoint;
20class BreakpointLocation;
21class Field;
22class GrowableObjectArray;
23class Instance;
24class JSONArray;
25class JSONObject;
26class MessageQueue;
27class Metric;
28class Object;
29class Script;
30class ServiceEvent;
31class String;
32class TimelineEvent;
33class TimelineEventBlock;
34class Thread;
35class ThreadRegistry;
36class Zone;
37
38// Keep this enum in sync with:
39//
40// - runtime/vm/service/vmservice.dart
41// - runtime/observatory/lib/src/service/object.dart
42// - pkg/dds/lib/src/rpc_error_codes.dart
43//
45 kParseError = -32700,
50
52
67
68 // Experimental (used in private rpcs).
72};
73
74// Builds on JSONWriter to provide support for serializing various objects
75// used in the VM service protocol.
77 public:
78 explicit JSONStream(intptr_t buf_size = 256);
79
80 void Setup(Zone* zone,
82 const Instance& seq,
83 const String& method,
84 const Array& param_keys,
85 const Array& param_values,
86 bool parameters_are_dart_objects = false);
87 void SetupError();
88
89 void PrintError(intptr_t code, const char* details_format, ...)
90 PRINTF_ATTRIBUTE(3, 4);
91
92 void PostReply();
93
95 ServiceIdZone* id_zone() { return id_zone_; }
96
97 TextBuffer* buffer() { return writer_.buffer(); }
98 const char* ToCString() { return writer_.ToCString(); }
99
100 void Steal(char** buffer, intptr_t* buffer_length) {
101 writer_.Steal(buffer, buffer_length);
102 }
103
105
106 bool include_private_members() const { return include_private_members_; }
108 include_private_members_ = include_private_members;
109 }
110
111 bool IsAllowableKey(const char* key) {
112 if (include_private_members_) {
113 return true;
114 }
115 return *key != '_';
116 }
117
118 void SetParams(const char** param_keys,
119 const char** param_values,
120 intptr_t num_params);
121
122 Dart_Port reply_port() const { return reply_port_; }
123
124 intptr_t NumObjectParameters() const;
125 ObjectPtr GetObjectParameterKey(intptr_t i) const;
126 ObjectPtr GetObjectParameterValue(intptr_t i) const;
127 ObjectPtr LookupObjectParam(const char* key) const;
128
129 intptr_t num_params() const { return num_params_; }
130 const char* GetParamKey(intptr_t i) const { return param_keys_[i]; }
131 const char* GetParamValue(intptr_t i) const { return param_values_[i]; }
132
133 const char* LookupParam(const char* key) const;
134
135 bool HasParam(const char* key) const;
136
137 // Returns true if there is an param with key and value, false
138 // otherwise.
139 bool ParamIs(const char* key, const char* value) const;
140
141 const char* method() const { return method_; }
142 const char** param_keys() const { return param_keys_; }
143 const char** param_values() const { return param_values_; }
144
145 void set_offset(intptr_t value) {
146 ASSERT(value >= 0);
147 offset_ = value;
148 }
149
150 void set_count(intptr_t value) {
151 ASSERT(value >= 0);
152 count_ = value;
153 }
154
155 void ComputeOffsetAndCount(intptr_t length,
156 intptr_t* offset,
157 intptr_t* count);
158
159 // Append |buffer| to the stream.
160 void AppendBytes(const uint8_t* buffer, intptr_t buffer_length) {
161 writer_.AppendBytes(buffer, buffer_length);
162 }
163
164 // Append |serialized_object| to the stream.
165 void AppendSerializedObject(const char* serialized_object) {
166 writer_.AppendSerializedObject(serialized_object);
167 }
168
169 // Append |serialized_object| to the stream with |property_name|.
170 void AppendSerializedObject(const char* property_name,
171 const char* serialized_object) {
172 writer_.AppendSerializedObject(property_name, serialized_object);
173 }
174
176 JSONWriter* writer() { return &writer_; }
177
178 private:
179 void Clear() { writer_.Clear(); }
180
181 void PostNullReply(Dart_Port port);
182
183 void OpenObject(const char* property_name = nullptr) {
184 if (ignore_object_depth_ > 0 ||
185 (property_name != nullptr && !IsAllowableKey(property_name))) {
186 ignore_object_depth_++;
187 return;
188 }
189 writer_.OpenObject(property_name);
190 }
191 void CloseObject() {
192 if (ignore_object_depth_ > 0) {
193 ignore_object_depth_--;
194 return;
195 }
196 writer_.CloseObject();
197 }
198 void UncloseObject() {
199 // This should be updated to handle unclosing a private object if we need
200 // to handle that case, which we don't currently.
201 writer_.UncloseObject();
202 }
203
204 void OpenArray(const char* property_name = nullptr) {
205 if (ignore_object_depth_ > 0 ||
206 (property_name != nullptr && !IsAllowableKey(property_name))) {
207 ignore_object_depth_++;
208 return;
209 }
210 writer_.OpenArray(property_name);
211 }
212 void CloseArray() {
213 if (ignore_object_depth_ > 0) {
214 ignore_object_depth_--;
215 return;
216 }
217 writer_.CloseArray();
218 }
219
220 // Append the Base64 encoding of |bytes| to the stream.
221 //
222 // Beware that padding characters are added when |length| is not a multiple of
223 // three. Padding is only valid at the end of Base64 strings, so you must be
224 // careful when trying to populate a single Base64 string with multiple calls
225 // to this method. |JSONBase64String| should be used for that use-case,
226 // because it handles padding management.
227 void AppendBytesInBase64(const uint8_t* bytes, intptr_t length) {
228 writer_.AppendBytesInBase64(bytes, length);
229 }
230 void PrintValueNull() { writer_.PrintValueNull(); }
231 void PrintValueBool(bool b) { writer_.PrintValueBool(b); }
232 void PrintValue(intptr_t i) { writer_.PrintValue(i); }
233 void PrintValue64(int64_t i) { writer_.PrintValue64(i); }
234 void PrintValueTimeMillis(int64_t millis) { writer_.PrintValue64(millis); }
235 void PrintValueTimeMicros(int64_t micros) { writer_.PrintValue64(micros); }
236 void PrintValue(double d) { writer_.PrintValue(d); }
237 void PrintValueBase64(const uint8_t* bytes, intptr_t length) {
238 writer_.PrintValueBase64(bytes, length);
239 }
240 void PrintValue(const char* s) { writer_.PrintValue(s); }
241 void PrintValueNoEscape(const char* s) { writer_.PrintValueNoEscape(s); }
242 bool PrintValueStr(const String& s, intptr_t offset, intptr_t count) {
243 return writer_.PrintValueStr(s, offset, count);
244 }
245 void PrintfValue(const char* format, ...) PRINTF_ATTRIBUTE(2, 3);
246 void VPrintfValue(const char* format, va_list args) {
247 writer_.VPrintfValue(format, args);
248 }
249
250 void PrintValue(const Object& o, bool ref = true);
251 void PrintValue(Breakpoint* bpt);
252 void PrintValue(TokenPosition tp);
253 void PrintValue(const ServiceEvent* event);
254 void PrintValue(Metric* metric);
255 void PrintValue(MessageQueue* queue);
256 void PrintValue(Isolate* isolate, bool ref = true);
257 void PrintValue(IsolateGroup* isolate, bool ref = true);
258 void PrintValue(const TimelineEvent* timeline_event);
259 void PrintValue(const TimelineEventBlock* timeline_event_block);
260 void PrintValueVM(bool ref = true);
261
262 void PrintServiceId(const Object& o);
263
264#define PRIVATE_NAME_CHECK() \
265 if (!IsAllowableKey(name) || ignore_object_depth_ > 0) { \
266 return; \
267 }
268
269 void PrintPropertyBool(const char* name, bool b) {
271 writer_.PrintPropertyBool(name, b);
272 }
273 void PrintProperty(const char* name, intptr_t i) {
275 writer_.PrintProperty(name, i);
276 }
277 void PrintProperty64(const char* name, int64_t i) {
279 writer_.PrintProperty64(name, i);
280 }
281 void PrintPropertyTimeMillis(const char* name, int64_t millis) {
283 writer_.PrintProperty64(name, millis);
284 }
285 void PrintPropertyTimeMicros(const char* name, int64_t micros) {
287 writer_.PrintProperty64(name, micros);
288 }
289 void PrintProperty(const char* name, double d) {
291 writer_.PrintProperty(name, d);
292 }
293 void PrintPropertyBase64(const char* name,
294 const uint8_t* bytes,
295 intptr_t length) {
297 writer_.PrintPropertyBase64(name, bytes, length);
298 }
299 void PrintProperty(const char* name, const char* s) {
301 writer_.PrintProperty(name, s);
302 }
303 bool PrintPropertyStr(const char* name,
304 const String& s,
305 intptr_t offset,
306 intptr_t count) {
307 if (!IsAllowableKey(name)) {
308 return false;
309 }
310 return writer_.PrintPropertyStr(name, s, offset, count);
311 }
312 void PrintPropertyNoEscape(const char* name, const char* s) {
314 writer_.PrintPropertyNoEscape(name, s);
315 }
316 void PrintfProperty(const char* name, const char* format, ...)
317 PRINTF_ATTRIBUTE(3, 4);
318 void VPrintfProperty(const char* name, const char* format, va_list args) {
320 writer_.VPrintfProperty(name, format, args);
321 }
322
323#undef PRIVATE_NAME_CHECK
324
325 void PrintProperty(const char* name, const Object& o, bool ref = true);
326
327 void PrintProperty(const char* name, const ServiceEvent* event);
328 void PrintProperty(const char* name, Breakpoint* bpt);
329 void PrintProperty(const char* name, TokenPosition tp);
330 void PrintProperty(const char* name, Metric* metric);
331 void PrintProperty(const char* name, MessageQueue* queue);
332 void PrintProperty(const char* name, Isolate* isolate);
333 void PrintProperty(const char* name, IsolateGroup* isolate_group);
334 void PrintProperty(const char* name, Zone* zone);
335 void PrintProperty(const char* name, const TimelineEvent* timeline_event);
336 void PrintProperty(const char* name,
337 const TimelineEventBlock* timeline_event_block);
338 void PrintPropertyVM(const char* name, bool ref = true);
339 void PrintPropertyName(const char* name) { writer_.PrintPropertyName(name); }
340
341 void AddEscapedUTF8String(const char* s, intptr_t len) {
342 writer_.AddEscapedUTF8String(s, len);
343 }
344
345 JSONWriter writer_;
346 // Default service id zone.
347 RingServiceIdZone default_id_zone_;
348 ServiceIdZone* id_zone_;
349 Dart_Port reply_port_;
350 Instance* seq_;
351 Array* parameter_keys_;
352 Array* parameter_values_;
353 const char* method_;
354 const char** param_keys_;
355 const char** param_values_;
356 intptr_t num_params_;
357 intptr_t offset_;
358 intptr_t count_;
359 int64_t setup_time_micros_;
360 bool include_private_members_;
361 intptr_t ignore_object_depth_;
362 friend class JSONObject;
363 friend class JSONArray;
364 friend class JSONBase64String;
365 friend class TimelineEvent;
366};
367
368class JSONObject : public ValueObject {
369 public:
370 explicit JSONObject(JSONStream* stream) : stream_(stream) {
371 stream_->OpenObject();
372 }
373 JSONObject(const JSONObject* obj, const char* name) : stream_(obj->stream_) {
374 stream_->OpenObject(name);
375 }
376 explicit JSONObject(const JSONArray* arr);
377
378 ~JSONObject() { stream_->CloseObject(); }
379
380 void AddServiceId(const Object& o) const { stream_->PrintServiceId(o); }
381
382 void AddFixedServiceId(const char* format, ...) const PRINTF_ATTRIBUTE(2, 3);
383 void AddServiceId(const char* format, ...) const PRINTF_ATTRIBUTE(2, 3);
384
385 void AddLocation(
386 const Script& script,
387 TokenPosition token_pos,
388 TokenPosition end_token_pos = TokenPosition::kNoSource) const;
389
390 void AddLocation(const BreakpointLocation* bpt_loc) const;
391 void AddLocationLine(const Script& script, intptr_t line) const;
392
393 void AddUnresolvedLocation(const BreakpointLocation* bpt_loc) const;
394
395 void AddProperty(const char* name, bool b) const {
396 stream_->PrintPropertyBool(name, b);
397 }
398 void AddProperty(const char* name, intptr_t i) const {
399 stream_->PrintProperty(name, i);
400 }
401 void AddProperty64(const char* name, int64_t i) const {
402 stream_->PrintProperty64(name, i);
403 }
404 void AddPropertyTimeMillis(const char* name, int64_t millis) const {
405 stream_->PrintPropertyTimeMillis(name, millis);
406 }
407 void AddPropertyTimeMicros(const char* name, int64_t micros) const {
408 stream_->PrintPropertyTimeMicros(name, micros);
409 }
410 void AddProperty(const char* name, double d) const {
411 stream_->PrintProperty(name, d);
412 }
413 void AddPropertyBase64(const char* name,
414 const uint8_t* bytes,
415 intptr_t length) const {
416 stream_->PrintPropertyBase64(name, bytes, length);
417 }
418 void AddProperty(const char* name, const char* s) const {
419 stream_->PrintProperty(name, s);
420 }
421 bool AddPropertyStr(const char* name,
422 const String& s,
423 intptr_t offset = 0,
424 intptr_t count = -1) const {
425 return stream_->PrintPropertyStr(name, s, offset, count);
426 }
427 void AddPropertyNoEscape(const char* name, const char* s) const {
428 stream_->PrintPropertyNoEscape(name, s);
429 }
430 void AddProperty(const char* name, const Object& obj, bool ref = true) const {
431 stream_->PrintProperty(name, obj, ref);
432 }
433 void AddProperty(const char* name, const ServiceEvent* event) const {
434 stream_->PrintProperty(name, event);
435 }
436 void AddProperty(const char* name, Breakpoint* bpt) const {
437 stream_->PrintProperty(name, bpt);
438 }
439 void AddProperty(const char* name, TokenPosition tp) const {
440 stream_->PrintProperty(name, tp);
441 }
442 void AddProperty(const char* name, Metric* metric) const {
443 stream_->PrintProperty(name, metric);
444 }
445 void AddProperty(const char* name, MessageQueue* queue) const {
446 stream_->PrintProperty(name, queue);
447 }
448 void AddProperty(const char* name, Isolate* isolate) const {
449 stream_->PrintProperty(name, isolate);
450 }
451 void AddProperty(const char* name, IsolateGroup* isolate_group) const {
452 stream_->PrintProperty(name, isolate_group);
453 }
454 void AddProperty(const char* name, Zone* zone) const {
455 stream_->PrintProperty(name, zone);
456 }
457 void AddProperty(const char* name,
458 const TimelineEvent* timeline_event) const {
459 stream_->PrintProperty(name, timeline_event);
460 }
461 void AddProperty(const char* name,
462 const TimelineEventBlock* timeline_event_block) const {
463 stream_->PrintProperty(name, timeline_event_block);
464 }
465 void AddPropertyVM(const char* name, bool ref = true) const {
466 stream_->PrintPropertyVM(name, ref);
467 }
468 void AddPropertyF(const char* name, const char* format, ...) const
469 PRINTF_ATTRIBUTE(3, 4);
470
471 private:
472 JSONStream* stream_;
473
474 friend class JSONArray;
475
476 DISALLOW_ALLOCATION();
477 DISALLOW_COPY_AND_ASSIGN(JSONObject);
478};
479
480class JSONArray : public ValueObject {
481 public:
482 explicit JSONArray(JSONStream* stream) : stream_(stream) {
483 stream_->OpenArray();
484 }
485 JSONArray(const JSONObject* obj, const char* name) : stream_(obj->stream_) {
486 stream_->OpenArray(name);
487 }
488 explicit JSONArray(const JSONArray* arr) : stream_(arr->stream_) {
489 stream_->OpenArray();
490 }
491 ~JSONArray() { stream_->CloseArray(); }
492
493 void AddValueNull() const { stream_->PrintValueNull(); }
494 void AddValue(bool b) const { stream_->PrintValueBool(b); }
495 void AddValue(intptr_t i) const { stream_->PrintValue(i); }
496 void AddValue64(int64_t i) const { stream_->PrintValue64(i); }
497 void AddValueTimeMillis(int64_t millis) const {
498 stream_->PrintValueTimeMillis(millis);
499 }
500 void AddValueTimeMicros(int64_t micros) const {
501 stream_->PrintValueTimeMicros(micros);
502 }
503 void AddValue(double d) const { stream_->PrintValue(d); }
504 void AddValue(const char* s) const { stream_->PrintValue(s); }
505 void AddValue(const Object& obj, bool ref = true) const {
506 stream_->PrintValue(obj, ref);
507 }
508 void AddValue(Isolate* isolate, bool ref = true) const {
509 stream_->PrintValue(isolate, ref);
510 }
511 void AddValue(IsolateGroup* isolate_group, bool ref = true) const {
512 stream_->PrintValue(isolate_group, ref);
513 }
514 void AddValue(Breakpoint* bpt) const { stream_->PrintValue(bpt); }
515 void AddValue(TokenPosition tp) const { stream_->PrintValue(tp); }
516 void AddValue(const ServiceEvent* event) const { stream_->PrintValue(event); }
517 void AddValue(Metric* metric) const { stream_->PrintValue(metric); }
518 void AddValue(MessageQueue* queue) const { stream_->PrintValue(queue); }
519 void AddValue(const TimelineEvent* timeline_event) const {
520 stream_->PrintValue(timeline_event);
521 }
522 void AddValue(const TimelineEventBlock* timeline_event_block) const {
523 stream_->PrintValue(timeline_event_block);
524 }
525 void AddValueVM(bool ref = true) const { stream_->PrintValueVM(ref); }
526 void AddValueF(const char* format, ...) const PRINTF_ATTRIBUTE(2, 3);
527
528 private:
529 JSONStream* stream_;
530
531 friend class JSONObject;
532
533 DISALLOW_ALLOCATION();
534 DISALLOW_COPY_AND_ASSIGN(JSONArray);
535};
536
538 public:
540 : stream_(stream), queued_bytes_(), num_queued_bytes_(0) {
541 stream_->AppendBytes(reinterpret_cast<const uint8_t*>("\""), 1);
542 }
544 stream_->AppendBytesInBase64(queued_bytes_, num_queued_bytes_);
545 stream_->AppendBytes(reinterpret_cast<const uint8_t*>("\""), 1);
546 }
547
548 void AppendBytes(const uint8_t* bytes, intptr_t length);
549
550 private:
551 JSONStream* stream_;
552 uint8_t queued_bytes_[3];
553 intptr_t num_queued_bytes_;
554
555 DISALLOW_ALLOCATION();
556 DISALLOW_COPY_AND_ASSIGN(JSONBase64String);
557};
558
559} // namespace dart
560
561#endif // RUNTIME_VM_JSON_STREAM_H_
int count
Definition: FontMgrTest.cpp:50
void AddValue64(int64_t i) const
Definition: json_stream.h:496
void AddValueTimeMicros(int64_t micros) const
Definition: json_stream.h:500
void AddValue(const char *s) const
Definition: json_stream.h:504
void AddValue(const TimelineEventBlock *timeline_event_block) const
Definition: json_stream.h:522
JSONArray(JSONStream *stream)
Definition: json_stream.h:482
void AddValue(double d) const
Definition: json_stream.h:503
void AddValue(intptr_t i) const
Definition: json_stream.h:495
JSONArray(const JSONObject *obj, const char *name)
Definition: json_stream.h:485
void AddValueNull() const
Definition: json_stream.h:493
void AddValue(const Object &obj, bool ref=true) const
Definition: json_stream.h:505
JSONArray(const JSONArray *arr)
Definition: json_stream.h:488
void AddValue(Metric *metric) const
Definition: json_stream.h:517
void AddValue(Isolate *isolate, bool ref=true) const
Definition: json_stream.h:508
void AddValueVM(bool ref=true) const
Definition: json_stream.h:525
void AddValueTimeMillis(int64_t millis) const
Definition: json_stream.h:497
void AddValue(const ServiceEvent *event) const
Definition: json_stream.h:516
void AddValue(bool b) const
Definition: json_stream.h:494
void AddValue(Breakpoint *bpt) const
Definition: json_stream.h:514
void AddValue(IsolateGroup *isolate_group, bool ref=true) const
Definition: json_stream.h:511
void AddValue(MessageQueue *queue) const
Definition: json_stream.h:518
void AddValue(const TimelineEvent *timeline_event) const
Definition: json_stream.h:519
void AddValue(TokenPosition tp) const
Definition: json_stream.h:515
JSONBase64String(JSONStream *stream)
Definition: json_stream.h:539
void AddPropertyVM(const char *name, bool ref=true) const
Definition: json_stream.h:465
void void void AddLocation(const Script &script, TokenPosition token_pos, TokenPosition end_token_pos=TokenPosition::kNoSource) const
Definition: json_stream.cc:521
void AddProperty64(const char *name, int64_t i) const
Definition: json_stream.h:401
void AddProperty(const char *name, const TimelineEvent *timeline_event) const
Definition: json_stream.h:457
void AddProperty(const char *name, Zone *zone) const
Definition: json_stream.h:454
void AddProperty(const char *name, bool b) const
Definition: json_stream.h:395
void AddProperty(const char *name, TokenPosition tp) const
Definition: json_stream.h:439
void AddServiceId(const Object &o) const
Definition: json_stream.h:380
void AddPropertyBase64(const char *name, const uint8_t *bytes, intptr_t length) const
Definition: json_stream.h:413
void AddProperty(const char *name, double d) const
Definition: json_stream.h:410
void AddPropertyTimeMicros(const char *name, int64_t micros) const
Definition: json_stream.h:407
void AddUnresolvedLocation(const BreakpointLocation *bpt_loc) const
Definition: json_stream.cc:560
bool AddPropertyStr(const char *name, const String &s, intptr_t offset=0, intptr_t count=-1) const
Definition: json_stream.h:421
void AddProperty(const char *name, const char *s) const
Definition: json_stream.h:418
void AddProperty(const char *name, Breakpoint *bpt) const
Definition: json_stream.h:436
void AddProperty(const char *name, MessageQueue *queue) const
Definition: json_stream.h:445
void AddPropertyNoEscape(const char *name, const char *s) const
Definition: json_stream.h:427
void AddFixedServiceId(const char *format,...) const PRINTF_ATTRIBUTE(2
Definition: json_stream.cc:503
JSONObject(const JSONObject *obj, const char *name)
Definition: json_stream.h:373
void AddProperty(const char *name, const TimelineEventBlock *timeline_event_block) const
Definition: json_stream.h:461
JSONObject(JSONStream *stream)
Definition: json_stream.h:370
void AddProperty(const char *name, Metric *metric) const
Definition: json_stream.h:442
void AddPropertyTimeMillis(const char *name, int64_t millis) const
Definition: json_stream.h:404
void AddProperty(const char *name, intptr_t i) const
Definition: json_stream.h:398
void AddProperty(const char *name, Isolate *isolate) const
Definition: json_stream.h:448
void AddPropertyF(const char *name, const char *format,...) const PRINTF_ATTRIBUTE(3
Definition: json_stream.cc:589
void AddProperty(const char *name, const ServiceEvent *event) const
Definition: json_stream.h:433
void AddProperty(const char *name, IsolateGroup *isolate_group) const
Definition: json_stream.h:451
void AddLocationLine(const Script &script, intptr_t line) const
Definition: json_stream.cc:550
void AddProperty(const char *name, const Object &obj, bool ref=true) const
Definition: json_stream.h:430
void Setup(Zone *zone, Dart_Port reply_port, const Instance &seq, const String &method, const Array &param_keys, const Array &param_values, bool parameters_are_dart_objects=false)
Definition: json_stream.cc:50
void PrintCommaIfNeeded()
Definition: json_stream.h:175
intptr_t num_params() const
Definition: json_stream.h:129
ObjectPtr GetObjectParameterKey(intptr_t i) const
Definition: json_stream.cc:456
ObjectPtr LookupObjectParam(const char *key) const
Definition: json_stream.cc:466
void set_include_private_members(bool include_private_members)
Definition: json_stream.h:107
bool ParamIs(const char *key, const char *value) const
Definition: json_stream.cc:287
JSONWriter * writer()
Definition: json_stream.h:176
bool include_private_members() const
Definition: json_stream.h:106
void ComputeOffsetAndCount(intptr_t length, intptr_t *offset, intptr_t *count)
Definition: json_stream.cc:294
void AppendSerializedObject(const char *serialized_object)
Definition: json_stream.h:165
Dart_Port reply_port() const
Definition: json_stream.h:122
void AppendBytes(const uint8_t *buffer, intptr_t buffer_length)
Definition: json_stream.h:160
const char * ToCString()
Definition: json_stream.h:98
bool HasParam(const char *key) const
Definition: json_stream.cc:282
const char * GetParamKey(intptr_t i) const
Definition: json_stream.h:130
const char ** param_values() const
Definition: json_stream.h:143
void void PostReply()
Definition: json_stream.cc:196
void set_offset(intptr_t value)
Definition: json_stream.h:145
void set_reply_port(Dart_Port port)
Definition: json_stream.cc:443
void set_count(intptr_t value)
Definition: json_stream.h:150
const char ** param_keys() const
Definition: json_stream.h:142
JSONStream(intptr_t buf_size=256)
Definition: json_stream.cc:26
intptr_t NumObjectParameters() const
Definition: json_stream.cc:447
TextBuffer * buffer()
Definition: json_stream.h:97
void PrintError(intptr_t code, const char *details_format,...) PRINTF_ATTRIBUTE(3
Definition: json_stream.cc:163
ObjectPtr GetObjectParameterValue(intptr_t i) const
Definition: json_stream.cc:461
friend class TimelineEvent
Definition: json_stream.h:365
const char * GetParamValue(intptr_t i) const
Definition: json_stream.h:131
void Steal(char **buffer, intptr_t *buffer_length)
Definition: json_stream.h:100
ServiceIdZone * id_zone()
Definition: json_stream.h:95
const char * LookupParam(const char *key) const
Definition: json_stream.cc:273
const char * method() const
Definition: json_stream.h:141
void SetParams(const char **param_keys, const char **param_values, intptr_t num_params)
Definition: json_stream.cc:479
void set_id_zone(ServiceIdZone *id_zone)
Definition: json_stream.h:94
bool IsAllowableKey(const char *key)
Definition: json_stream.h:111
void AppendSerializedObject(const char *property_name, const char *serialized_object)
Definition: json_stream.h:170
void AppendBytesInBase64(const uint8_t *bytes, intptr_t length)
Definition: json_writer.cc:46
bool PrintPropertyStr(const char *name, const String &s, intptr_t offset=0, intptr_t count=-1)
Definition: json_writer.cc:256
void PrintPropertyBool(const char *name, bool b)
Definition: json_writer.cc:224
void PrintProperty64(const char *name, int64_t i)
Definition: json_writer.cc:234
void UncloseObject()
Definition: json_writer.cc:98
void PrintPropertyBase64(const char *name, const uint8_t *bytes, intptr_t length)
Definition: json_writer.cc:249
void PrintCommaIfNeeded()
Definition: json_writer.cc:320
void Steal(char **buffer, intptr_t *buffer_length)
Definition: json_writer.cc:300
void PrintValue(intptr_t i)
Definition: json_writer.cc:137
void PrintValueBase64(const uint8_t *bytes, intptr_t length)
Definition: json_writer.cc:159
void PrintValueBool(bool b)
Definition: json_writer.cc:132
const char * ToCString()
Definition: json_writer.h:20
void PrintProperty(const char *name, intptr_t i)
Definition: json_writer.cc:229
void PrintPropertyName(const char *name)
Definition: json_writer.cc:307
void void VPrintfValue(const char *format, va_list args)
Definition: json_writer.cc:202
void OpenArray(const char *property_name=nullptr)
Definition: json_writer.cc:112
void AppendBytes(const uint8_t *buffer, intptr_t buffer_length)
Definition: json_writer.cc:38
TextBuffer * buffer()
Definition: json_writer.h:19
bool PrintValueStr(const String &s, intptr_t offset, intptr_t count)
Definition: json_writer.cc:180
void AppendSerializedObject(const char *serialized_object)
Definition: json_writer.cc:72
void void VPrintfProperty(const char *name, const char *format, va_list args)
Definition: json_writer.cc:276
void AddEscapedUTF8String(const char *s)
Definition: json_writer.cc:348
void PrintValueNoEscape(const char *s)
Definition: json_writer.cc:190
void OpenObject(const char *property_name=nullptr)
Definition: json_writer.cc:89
void PrintValue64(int64_t i)
Definition: json_writer.cc:143
void PrintPropertyNoEscape(const char *name, const char *s)
Definition: json_writer.cc:264
int64_t Dart_Port
Definition: dart_api.h:1525
#define ASSERT(E)
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
Definition: main.cc:19
VkQueue queue
Definition: main.cc:55
static bool b
struct MyStruct s
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
FlKeyEvent * event
uint8_t value
uint32_t uint32_t * format
#define PRIVATE_NAME_CHECK()
Definition: json_stream.h:264
size_t length
Definition: dart_vm.cc:33
const char *const name
JSONRpcErrorCode
Definition: json_stream.h:44
@ kExpressionCompilationError
Definition: json_stream.h:65
@ kParseError
Definition: json_stream.h:45
@ kCannotAddBreakpoint
Definition: json_stream.h:54
@ kFileDoesNotExist
Definition: json_stream.h:71
@ kExtensionError
Definition: json_stream.h:51
@ kStreamNotSubscribed
Definition: json_stream.h:56
@ kCannotResume
Definition: json_stream.h:59
@ kInternalError
Definition: json_stream.h:49
@ kServiceAlreadyRegistered
Definition: json_stream.h:63
@ kMethodNotFound
Definition: json_stream.h:47
@ kFeatureDisabled
Definition: json_stream.h:53
@ kIsolateMustHaveReloaded
Definition: json_stream.h:62
@ kIsolateIsReloading
Definition: json_stream.h:60
@ kStreamAlreadySubscribed
Definition: json_stream.h:55
@ kFileSystemDoesNotExist
Definition: json_stream.h:70
@ kIsolateMustBePaused
Definition: json_stream.h:58
@ kInvalidRequest
Definition: json_stream.h:46
@ kIsolateMustBeRunnable
Definition: json_stream.h:57
@ kFileSystemAlreadyExists
Definition: json_stream.h:69
@ kInvalidTimelineRequest
Definition: json_stream.h:66
@ kInvalidParams
Definition: json_stream.h:48
@ kServiceDisappeared
Definition: json_stream.h:64
@ kIsolateReloadBarred
Definition: json_stream.h:61
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service port
Definition: switches.h:87
#define PRINTF_ATTRIBUTE(string_index, first_to_check)
Definition: globals.h:697
SeparatedVector2 offset