| 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 VM_JSON_STREAM_H_ | 5 #ifndef VM_JSON_STREAM_H_ |
| 6 #define VM_JSON_STREAM_H_ | 6 #define 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/json.h" | 9 #include "platform/json.h" |
| 10 #include "vm/allocation.h" | 10 #include "vm/allocation.h" |
| 11 #include "vm/service.h" | 11 #include "vm/service.h" |
| 12 | 12 |
| 13 namespace dart { | 13 namespace dart { |
| 14 | 14 |
| 15 class Array; | 15 class Array; |
| 16 class Field; | 16 class Field; |
| 17 class GrowableObjectArray; | 17 class GrowableObjectArray; |
| 18 class Instance; | 18 class Instance; |
| 19 class JSONArray; | 19 class JSONArray; |
| 20 class JSONObject; | 20 class JSONObject; |
| 21 class MessageQueue; | 21 class MessageQueue; |
| 22 class Metric; | 22 class Metric; |
| 23 class Object; | 23 class Object; |
| 24 class Script; |
| 24 class ServiceEvent; | 25 class ServiceEvent; |
| 25 class Breakpoint; | 26 class Breakpoint; |
| 26 class String; | 27 class String; |
| 27 class Zone; | 28 class Zone; |
| 28 | 29 |
| 29 | 30 |
| 30 // Keep this in sync with runtime/observatory/lib/src/service/object.dart. | 31 // Keep this in sync with runtime/observatory/lib/src/service/object.dart. |
| 31 enum JSONRpcErrorCode { | 32 enum JSONRpcErrorCode { |
| 32 kParseError = -32700, | 33 kParseError = -32700, |
| 33 kInvalidRequest = -32600, | 34 kInvalidRequest = -32600, |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 ~JSONObject() { | 180 ~JSONObject() { |
| 180 stream_->CloseObject(); | 181 stream_->CloseObject(); |
| 181 } | 182 } |
| 182 | 183 |
| 183 void AddServiceId(const Object& o) const { | 184 void AddServiceId(const Object& o) const { |
| 184 stream_->PrintServiceId(o); | 185 stream_->PrintServiceId(o); |
| 185 } | 186 } |
| 186 | 187 |
| 187 void AddFixedServiceId(const char* format, ...) const PRINTF_ATTRIBUTE(2, 3); | 188 void AddFixedServiceId(const char* format, ...) const PRINTF_ATTRIBUTE(2, 3); |
| 188 | 189 |
| 190 void AddLocation(const Script& script, |
| 191 intptr_t token_pos, |
| 192 intptr_t end_token_pos = -1); |
| 193 |
| 189 void AddProperty(const char* name, bool b) const { | 194 void AddProperty(const char* name, bool b) const { |
| 190 stream_->PrintPropertyBool(name, b); | 195 stream_->PrintPropertyBool(name, b); |
| 191 } | 196 } |
| 192 void AddProperty(const char* name, intptr_t i) const { | 197 void AddProperty(const char* name, intptr_t i) const { |
| 193 stream_->PrintProperty(name, i); | 198 stream_->PrintProperty(name, i); |
| 194 } | 199 } |
| 195 void AddProperty64(const char* name, int64_t i) const { | 200 void AddProperty64(const char* name, int64_t i) const { |
| 196 stream_->PrintProperty64(name, i); | 201 stream_->PrintProperty64(name, i); |
| 197 } | 202 } |
| 198 void AddProperty(const char* name, double d) const { | 203 void AddProperty(const char* name, double d) const { |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 | 290 |
| 286 friend class JSONObject; | 291 friend class JSONObject; |
| 287 | 292 |
| 288 DISALLOW_ALLOCATION(); | 293 DISALLOW_ALLOCATION(); |
| 289 DISALLOW_COPY_AND_ASSIGN(JSONArray); | 294 DISALLOW_COPY_AND_ASSIGN(JSONArray); |
| 290 }; | 295 }; |
| 291 | 296 |
| 292 } // namespace dart | 297 } // namespace dart |
| 293 | 298 |
| 294 #endif // VM_JSON_STREAM_H_ | 299 #endif // VM_JSON_STREAM_H_ |
| OLD | NEW |