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

Side by Side Diff: runtime/bin/vmservice/client/lib/src/service/service.dart

Issue 197853005: Show object pool on code page (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 part of service; 5 part of service;
6 6
7 /// A [ServiceObject] is an object known to the VM service and is tied 7 /// A [ServiceObject] is an object known to the VM service and is tied
8 /// to an owning [Isolate]. 8 /// to an owning [Isolate].
9 abstract class ServiceObject extends Observable { 9 abstract class ServiceObject extends Observable {
10 Isolate _isolate; 10 Isolate _isolate;
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 } else if (v is ObservableMap) { 157 } else if (v is ObservableMap) {
158 _upgradeObservableMap(v, vm, isolate); 158 _upgradeObservableMap(v, vm, isolate);
159 } 159 }
160 } 160 }
161 } 161 }
162 162
163 /// Upgrades response ([m]) from [vm] and [isolate] to a [ServiceObject]. 163 /// Upgrades response ([m]) from [vm] and [isolate] to a [ServiceObject].
164 /// This acts like a factory which consumes an ObservableMap and returns 164 /// This acts like a factory which consumes an ObservableMap and returns
165 /// a fully upgraded ServiceObject. 165 /// a fully upgraded ServiceObject.
166 ServiceObject _upgradeToServiceObject(VM vm, Isolate isolate, ObservableMap m) { 166 ServiceObject _upgradeToServiceObject(VM vm, Isolate isolate, ObservableMap m) {
167 if (m == null) {
168 return null;
169 }
167 if (!ServiceObject.isServiceMap(m)) { 170 if (!ServiceObject.isServiceMap(m)) {
168 Logger.root.severe("Malformed service object: $m"); 171 Logger.root.severe("Malformed service object: $m");
169 } 172 }
170 assert(ServiceObject.isServiceMap(m)); 173 assert(ServiceObject.isServiceMap(m));
171 var type = ServiceObject.stripRef(m['type']); 174 var type = ServiceObject.stripRef(m['type']);
172 switch (type) { 175 switch (type) {
173 case 'Error': 176 case 'Error':
174 return new ServiceError.fromMap(isolate, m); 177 return new ServiceError.fromMap(isolate, m);
175 case 'IsolateList': 178 case 'IsolateList':
176 vm.isolates.update(m); 179 vm.isolates.update(m);
177 return vm.isolates; 180 return vm.isolates;
178 case 'Script': 181 case 'Script':
179 return isolate.scripts.putIfAbsent(m); 182 return isolate.scripts.putIfAbsent(m);
180 case 'Code': 183 case 'Code':
181 return isolate.codes.putIfAbsent(m); 184 return isolate.codes.putIfAbsent(m);
182 case 'Isolate': 185 case 'Isolate':
183 return vm.isolates.getIsolateFromMap(m); 186 return vm.isolates.getIsolateFromMap(m);
184 case 'Class': 187 case 'Class':
185 return isolate.classes.putIfAbsent(m); 188 return isolate.classes.putIfAbsent(m);
186 case 'Function': 189 case 'Function':
187 return isolate.functions.putIfAbsent(m); 190 return isolate.functions.putIfAbsent(m);
188 } 191 }
189 return new ServiceMap.fromMap(isolate, m); 192 return new ServiceMap.fromMap(isolate, m);
190 } 193 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698