Chromium Code Reviews| Index: runtime/vm/service.cc |
| diff --git a/runtime/vm/service.cc b/runtime/vm/service.cc |
| index dce3eace094526f7a174917c6e957cd7111e8aa4..aa01c894def742bdaa9eb4996ed1e971b66e9129 100644 |
| --- a/runtime/vm/service.cc |
| +++ b/runtime/vm/service.cc |
| @@ -3758,19 +3758,21 @@ static bool GetVersion(Thread* thread, JSONStream* js) { |
| class ServiceIsolateVisitor : public IsolateVisitor { |
| public: |
| - explicit ServiceIsolateVisitor(JSONArray* jsarr) : jsarr_(jsarr) {} |
| + explicit ServiceIsolateVisitor(JSONArray* jsarr, bool ref = true) |
|
zra
2016/12/08 18:54:13
Unless I'm missing something, this class only has
bkonyi
2016/12/08 20:58:32
You're right, it's only instantiated once. I've re
|
| + : jsarr_(jsarr), ref_(ref) {} |
| virtual ~ServiceIsolateVisitor() {} |
| void VisitIsolate(Isolate* isolate) { |
| if ((isolate != Dart::vm_isolate()) && |
| !ServiceIsolate::IsServiceIsolateDescendant(isolate)) { |
| - jsarr_->AddValue(isolate); |
| + jsarr_->AddValue(isolate, ref_); |
| } |
| } |
| private: |
| JSONArray* jsarr_; |
| + bool ref_; |
| }; |
| @@ -3800,7 +3802,7 @@ void Service::PrintJSONForVM(JSONStream* js, bool ref) { |
| // Construct the isolate list. |
| { |
| JSONArray jsarr(&jsobj, "isolates"); |
| - ServiceIsolateVisitor visitor(&jsarr); |
| + ServiceIsolateVisitor visitor(&jsarr, ref); |
| Isolate::VisitIsolates(&visitor); |
| } |
| } |