| Index: runtime/observatory/lib/src/elements/class_view.dart
|
| diff --git a/runtime/observatory/lib/src/elements/class_view.dart b/runtime/observatory/lib/src/elements/class_view.dart
|
| index d839614fa7afbc647dcd35d11e46bfa45303ee46..7ca6fb893215d4d9e2e747986ca1c58ecd3fd845 100644
|
| --- a/runtime/observatory/lib/src/elements/class_view.dart
|
| +++ b/runtime/observatory/lib/src/elements/class_view.dart
|
| @@ -6,6 +6,8 @@ library class_view_element;
|
|
|
| import 'dart:async';
|
| import 'observatory_element.dart';
|
| +import 'package:observatory/cpu_profile.dart';
|
| +import 'package:observatory/elements.dart';
|
| import 'package:observatory/service.dart';
|
| import 'package:polymer/polymer.dart';
|
|
|
| @@ -61,4 +63,24 @@ class ClassViewElement extends ObservatoryElement {
|
| Future refreshCoverage() {
|
| return cls.refreshCoverage();
|
| }
|
| +
|
| + final CpuProfile profile = new CpuProfile();
|
| +
|
| + Future refreshAllocationProfile() async {
|
| + var profileResponse = await cls.getAllocationSamples('UserVM');
|
| + profile.load(profileResponse.isolate, profileResponse);
|
| + CpuProfileTreeElement cpuProfileTreeElement =
|
| + shadowRoot.querySelector('#cpuProfileTree');
|
| + cpuProfileTreeElement.profile = profile;
|
| + cpuProfileTreeElement.direction = ProfileTreeDirection.Exclusive;
|
| + cpuProfileTreeElement.mode = ProfileTreeMode.Function;
|
| + cpuProfileTreeElement.render();
|
| + }
|
| +
|
| + Future toggleAllocationTrace() {
|
| + if (cls == null) {
|
| + return new Future(refresh);
|
| + }
|
| + return cls.setTraceAllocations(!cls.traceAllocations).whenComplete(refresh);
|
| + }
|
| }
|
|
|