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

Unified Diff: runtime/observatory/lib/src/repositories/editor.dart

Issue 3002843002: Introduce heap snapshot into Memory Dashboard (Closed)
Patch Set: Address CL comments Created 3 years, 4 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/observatory/lib/src/models/repositories/editor.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/observatory/lib/src/repositories/editor.dart
diff --git a/runtime/observatory/lib/src/repositories/editor.dart b/runtime/observatory/lib/src/repositories/editor.dart
index 80b4b624d65b5e3540c290e5783379bb1b380e31..d58cb36246f8a910ef0af4a72cf8b22ba11bb282 100644
--- a/runtime/observatory/lib/src/repositories/editor.dart
+++ b/runtime/observatory/lib/src/repositories/editor.dart
@@ -8,7 +8,7 @@ class EditorRepository extends M.EditorRepository {
final S.VM _vm;
final String _editor;
- bool get canOpenClass => _getService() != null;
+ bool get isAvailable => _getService() != null;
EditorRepository(S.VM vm, {String editor})
: _vm = vm,
@@ -40,6 +40,53 @@ class EditorRepository extends M.EditorRepository {
return await openSourceLocation(i, clazz.location);
}
+ Future openField(M.IsolateRef i, M.FieldRef f) async {
+ S.Field field = f as S.Field;
+ assert(field != null);
+ if (!field.loaded) {
+ await field.load();
+ }
+ if (field.location == null) {
+ return new Future.value();
+ }
+ return await openSourceLocation(i, field.location);
+ }
+
+ Future openFunction(M.IsolateRef i, M.FunctionRef f) async {
+ S.ServiceFunction field = f as S.ServiceFunction;
+ assert(field != null);
+ if (!field.loaded) {
+ await field.load();
+ }
+ if (field.location == null) {
+ return new Future.value();
+ }
+ return await openSourceLocation(i, field.location);
+ }
+
+ Future openObject(M.IsolateRef i, M.ObjectRef o) async {
+ assert(o != null);
+ if (o is M.ClassRef) {
+ return await openClass(i, o);
+ }
+ if (o is M.InstanceRef) {
+ return await openClass(i, o.clazz);
+ }
+ if (o is M.FieldRef) {
+ return await openField(i, o);
+ }
+ if (o is M.FunctionRef) {
+ return await openFunction(i, o);
+ }
+ if (o is M.InstanceRef) {
+ if (o.closureFunction != null) {
+ return await openFunction(i, o.closureFunction);
+ }
+ return await openClass(i, o.clazz);
+ }
+ return new Future.value();
+ }
+
Future openSourceLocation(M.IsolateRef i, M.SourceLocation l) async {
final isolate = i as S.Isolate;
assert(isolate != null);
« no previous file with comments | « runtime/observatory/lib/src/models/repositories/editor.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698