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

Unified Diff: runtime/vm/object.cc

Issue 542473003: Teach the Observatory about MirrorReferences. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: build Created 6 years, 3 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/bin/vmservice/observatory/test/mirror_references_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index dad2fbef012ca63581afc474f243c3d8041ae51b..c7ef20ed235e10a0ae0afce94fdad8a893a6e717 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -19543,7 +19543,18 @@ const char* MirrorReference::ToCString() const {
void MirrorReference::PrintJSONImpl(JSONStream* stream, bool ref) const {
- Instance::PrintJSONImpl(stream, ref);
+ JSONObject jsobj(stream);
+ PrintSharedInstanceJSON(&jsobj, ref);
+ ObjectIdRing* ring = Isolate::Current()->object_id_ring();
+ const intptr_t id = ring->GetIdForObject(raw());
+ jsobj.AddPropertyF("id", "objects/%" Pd "", id);
+
+ if (ref) {
+ return;
+ }
+
+ const Object& referent_handle = Object::Handle(referent());
+ jsobj.AddProperty("referent", referent_handle);
}
« no previous file with comments | « runtime/bin/vmservice/observatory/test/mirror_references_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698