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

Unified Diff: runtime/vm/object.h

Issue 257053003: Always use the same json for null in the vm service. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: gen js Created 6 years, 8 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
« no previous file with comments | « runtime/vm/json_test.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.h
diff --git a/runtime/vm/object.h b/runtime/vm/object.h
index d833f7cc8a8a5d789911bfbfa14dbdcbb4890e61..76e49f22ee495eeb97a9a8527f444ac2510dc674 100644
--- a/runtime/vm/object.h
+++ b/runtime/vm/object.h
@@ -134,11 +134,12 @@ class Symbols;
/* Object is printed as JSON into stream. If ref is true only a header */ \
/* with an object id is printed. If ref is false the object is fully */ \
/* printed. */ \
- virtual void PrintToJSONStream(JSONStream* stream, bool ref = true) const; \
virtual const char* JSONType(bool ref) const { \
return ref ? "@"#object : ""#object; \
} \
static const ClassId kClassId = k##object##Cid; \
+ protected: /* NOLINT */ \
+ virtual void PrintJSONImpl(JSONStream* stream, bool ref) const; \
private: /* NOLINT */ \
/* Initialize the handle based on the raw_ptr in the presence of null. */ \
static void initializeHandle(object* obj, RawObject* raw_ptr) { \
@@ -268,10 +269,7 @@ class Object {
}
}
- virtual void PrintToJSONStream(JSONStream* stream, bool ref = true) const {
- JSONObject jsobj(stream);
- jsobj.AddProperty("type", JSONType(ref));
- }
+ void PrintJSON(JSONStream* stream, bool ref = true) const;
virtual const char* JSONType(bool ref) const {
return IsNull() ? "null" : "Object";
@@ -544,6 +542,12 @@ class Object {
RawObject* raw_; // The raw object reference.
+ protected:
+ virtual void PrintJSONImpl(JSONStream* stream, bool ref) const {
+ JSONObject jsobj(stream);
+ jsobj.AddProperty("type", JSONType(ref));
+ }
+
private:
static intptr_t NextFieldOffset() {
// Indicates this class cannot be extended by dart code.
@@ -4173,10 +4177,10 @@ class Instance : public Object {
HEAP_OBJECT_IMPLEMENTATION(Instance, Object);
friend class Class;
friend class Closure;
+ friend class DeferredObject;
friend class SnapshotWriter;
friend class StubCode;
friend class TypedDataView;
- friend class DeferredObject;
};
« no previous file with comments | « runtime/vm/json_test.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698