| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS 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 | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef RUNTIME_VM_JSON_STREAM_H_ | 5 #ifndef RUNTIME_VM_JSON_STREAM_H_ |
| 6 #define RUNTIME_VM_JSON_STREAM_H_ | 6 #define RUNTIME_VM_JSON_STREAM_H_ |
| 7 | 7 |
| 8 #include "include/dart_api.h" // for Dart_Port | 8 #include "include/dart_api.h" // for Dart_Port |
| 9 #include "platform/text_buffer.h" | 9 #include "platform/text_buffer.h" |
| 10 #include "vm/allocation.h" | 10 #include "vm/allocation.h" |
| 11 #include "vm/service.h" | 11 #include "vm/service.h" |
| 12 #include "vm/token_position.h" | 12 #include "vm/token_position.h" |
| 13 | 13 |
| 14 | |
| 15 namespace dart { | 14 namespace dart { |
| 16 | 15 |
| 17 class Array; | 16 class Array; |
| 18 class Breakpoint; | 17 class Breakpoint; |
| 19 class BreakpointLocation; | 18 class BreakpointLocation; |
| 20 class Field; | 19 class Field; |
| 21 class GrowableObjectArray; | 20 class GrowableObjectArray; |
| 22 class Instance; | 21 class Instance; |
| 23 class JSONArray; | 22 class JSONArray; |
| 24 class JSONObject; | 23 class JSONObject; |
| 25 class MessageQueue; | 24 class MessageQueue; |
| 26 class Metric; | 25 class Metric; |
| 27 class Object; | 26 class Object; |
| 28 class Script; | 27 class Script; |
| 29 class ServiceEvent; | 28 class ServiceEvent; |
| 30 class String; | 29 class String; |
| 31 class TimelineEvent; | 30 class TimelineEvent; |
| 32 class TimelineEventBlock; | 31 class TimelineEventBlock; |
| 33 class Thread; | 32 class Thread; |
| 34 class ThreadRegistry; | 33 class ThreadRegistry; |
| 35 class Zone; | 34 class Zone; |
| 36 | 35 |
| 37 | |
| 38 // Keep this enum in sync with: | 36 // Keep this enum in sync with: |
| 39 // | 37 // |
| 40 // - runtime/vm/service/vmservice.dart | 38 // - runtime/vm/service/vmservice.dart |
| 41 // - runtime/observatory/lib/src/service/object.dart | 39 // - runtime/observatory/lib/src/service/object.dart |
| 42 // | 40 // |
| 43 enum JSONRpcErrorCode { | 41 enum JSONRpcErrorCode { |
| 44 kParseError = -32700, | 42 kParseError = -32700, |
| 45 kInvalidRequest = -32600, | 43 kInvalidRequest = -32600, |
| 46 kMethodNotFound = -32601, | 44 kMethodNotFound = -32601, |
| 47 kInvalidParams = -32602, | 45 kInvalidParams = -32602, |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 const char** param_values_; | 246 const char** param_values_; |
| 249 intptr_t num_params_; | 247 intptr_t num_params_; |
| 250 intptr_t offset_; | 248 intptr_t offset_; |
| 251 intptr_t count_; | 249 intptr_t count_; |
| 252 int64_t setup_time_micros_; | 250 int64_t setup_time_micros_; |
| 253 | 251 |
| 254 friend class JSONObject; | 252 friend class JSONObject; |
| 255 friend class JSONArray; | 253 friend class JSONArray; |
| 256 }; | 254 }; |
| 257 | 255 |
| 258 | |
| 259 class JSONObject : public ValueObject { | 256 class JSONObject : public ValueObject { |
| 260 public: | 257 public: |
| 261 explicit JSONObject(JSONStream* stream) : stream_(stream) { | 258 explicit JSONObject(JSONStream* stream) : stream_(stream) { |
| 262 stream_->OpenObject(); | 259 stream_->OpenObject(); |
| 263 } | 260 } |
| 264 JSONObject(const JSONObject* obj, const char* name) : stream_(obj->stream_) { | 261 JSONObject(const JSONObject* obj, const char* name) : stream_(obj->stream_) { |
| 265 stream_->OpenObject(name); | 262 stream_->OpenObject(name); |
| 266 } | 263 } |
| 267 explicit JSONObject(const JSONArray* arr); | 264 explicit JSONObject(const JSONArray* arr); |
| 268 | 265 |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 | 359 |
| 363 private: | 360 private: |
| 364 JSONStream* stream_; | 361 JSONStream* stream_; |
| 365 | 362 |
| 366 friend class JSONArray; | 363 friend class JSONArray; |
| 367 | 364 |
| 368 DISALLOW_ALLOCATION(); | 365 DISALLOW_ALLOCATION(); |
| 369 DISALLOW_COPY_AND_ASSIGN(JSONObject); | 366 DISALLOW_COPY_AND_ASSIGN(JSONObject); |
| 370 }; | 367 }; |
| 371 | 368 |
| 372 | |
| 373 class JSONArray : public ValueObject { | 369 class JSONArray : public ValueObject { |
| 374 public: | 370 public: |
| 375 explicit JSONArray(JSONStream* stream) : stream_(stream) { | 371 explicit JSONArray(JSONStream* stream) : stream_(stream) { |
| 376 stream_->OpenArray(); | 372 stream_->OpenArray(); |
| 377 } | 373 } |
| 378 JSONArray(const JSONObject* obj, const char* name) : stream_(obj->stream_) { | 374 JSONArray(const JSONObject* obj, const char* name) : stream_(obj->stream_) { |
| 379 stream_->OpenArray(name); | 375 stream_->OpenArray(name); |
| 380 } | 376 } |
| 381 explicit JSONArray(const JSONArray* arr) : stream_(arr->stream_) { | 377 explicit JSONArray(const JSONArray* arr) : stream_(arr->stream_) { |
| 382 stream_->OpenArray(); | 378 stream_->OpenArray(); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 | 418 |
| 423 friend class JSONObject; | 419 friend class JSONObject; |
| 424 | 420 |
| 425 DISALLOW_ALLOCATION(); | 421 DISALLOW_ALLOCATION(); |
| 426 DISALLOW_COPY_AND_ASSIGN(JSONArray); | 422 DISALLOW_COPY_AND_ASSIGN(JSONArray); |
| 427 }; | 423 }; |
| 428 | 424 |
| 429 } // namespace dart | 425 } // namespace dart |
| 430 | 426 |
| 431 #endif // RUNTIME_VM_JSON_STREAM_H_ | 427 #endif // RUNTIME_VM_JSON_STREAM_H_ |
| OLD | NEW |