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

Unified Diff: runtime/observatory/lib/src/service/object.dart

Issue 2771293003: Resubmission of native memory allocation info surfacing in Observatory. Fixed crashing tests and st… (Closed)
Patch Set: Added page to Observatory to display native memory allocation information. Created 3 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 side-by-side diff with in-line comments
Download patch
Index: runtime/observatory/lib/src/service/object.dart
diff --git a/runtime/observatory/lib/src/service/object.dart b/runtime/observatory/lib/src/service/object.dart
index cbaae26eff6135bc776a8fa7e941aeac4a4af569..656bf20dc713b20b8808c7ac05670360498aa9e4 100644
--- a/runtime/observatory/lib/src/service/object.dart
+++ b/runtime/observatory/lib/src/service/object.dart
@@ -776,29 +776,28 @@ abstract class VM extends ServiceObjectOwner implements M.VM {
return this;
}
- assert(type == 'Isolate');
String id = map['id'];
- if (!id.startsWith(_isolateIdPrefix)) {
- // Currently the VM only supports upgrading Isolate ServiceObjects.
- throw new UnimplementedError();
- }
-
- // Check cache.
- var isolate = _isolateCache[id];
- if (isolate == null) {
- // Add new isolate to the cache.
- isolate = new ServiceObject._fromMap(this, map);
- _isolateCache[id] = isolate;
- _buildIsolateList();
-
- // Eagerly load the isolate.
- isolate.load().catchError((e, stack) {
- Logger.root.info('Eagerly loading an isolate failed: $e\n$stack');
- });
- } else {
- isolate.update(map);
+ if ((id != null) && id.startsWith(_isolateIdPrefix)) {
+ // Check cache.
+ var isolate = _isolateCache[id];
+ if (isolate == null) {
+ // Add new isolate to the cache.
+ isolate = new ServiceObject._fromMap(this, map);
+ _isolateCache[id] = isolate;
+ _buildIsolateList();
+
+ // Eagerly load the isolate.
+ isolate.load().catchError((e, stack) {
+ Logger.root.info('Eagerly loading an isolate failed: $e\n$stack');
+ });
+ } else {
+ isolate.update(map);
+ }
+ return isolate;
}
- return isolate;
+
+ // Build the object from the map directly.
+ return new ServiceObject._fromMap(this, map);
}
// Note that this function does not reload the isolate if it found
@@ -3009,7 +3008,7 @@ class ServiceFunction extends HeapObject implements M.Function {
ServiceFunction._empty(ServiceObject owner) : super._empty(owner);
void _update(Map map, bool mapIsRef) {
- _upgradeCollection(map, isolate);
+ _upgradeCollection(map, owner);
super._update(map, mapIsRef);
name = map['name'];
« no previous file with comments | « runtime/observatory/lib/src/repositories/sample_profile.dart ('k') | runtime/observatory/observatory_sources.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698