| 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 7ca6fb893215d4d9e2e747986ca1c58ecd3fd845..cfd535b1a2b47e8a057c6da34e7329a77790d7ef 100644
|
| --- a/runtime/observatory/lib/src/elements/class_view.dart
|
| +++ b/runtime/observatory/lib/src/elements/class_view.dart
|
| @@ -17,6 +17,10 @@ class ClassViewElement extends ObservatoryElement {
|
| @observable ServiceMap instances;
|
| @observable int retainedBytes;
|
| @observable ObservableList mostRetained;
|
| + SampleBufferControlElement sampleBufferControlElement;
|
| + StackTraceTreeConfigElement stackTraceTreeConfigElement;
|
| + CpuProfileTreeElement cpuProfileTreeElement;
|
| +
|
| ClassViewElement.created() : super.created();
|
|
|
| Future<ServiceObject> evaluate(String expression) {
|
| @@ -47,7 +51,22 @@ class ClassViewElement extends ObservatoryElement {
|
| }
|
|
|
| void attached() {
|
| + super.attached();
|
| + sampleBufferControlElement =
|
| + shadowRoot.querySelector('#sampleBufferControl');
|
| + assert(sampleBufferControlElement != null);
|
| + sampleBufferControlElement.onSampleBufferUpdate = onSampleBufferChange;
|
| + sampleBufferControlElement.state =
|
| + SampleBufferControlElement.kNotLoadedState;
|
| + stackTraceTreeConfigElement =
|
| + shadowRoot.querySelector('#stackTraceTreeConfig');
|
| + assert(stackTraceTreeConfigElement != null);
|
| + stackTraceTreeConfigElement.onTreeConfigChange = onTreeConfigChange;
|
| + cpuProfileTreeElement = shadowRoot.querySelector('#cpuProfileTree');
|
| + assert(cpuProfileTreeElement != null);
|
| + cpuProfileTreeElement.profile = sampleBufferControlElement.profile;
|
| cls.fields.forEach((field) => field.reload());
|
| + sampleBufferControlElement.allocationProfileClass = cls;
|
| }
|
|
|
| Future refresh() {
|
| @@ -64,19 +83,28 @@ class ClassViewElement extends ObservatoryElement {
|
| return cls.refreshCoverage();
|
| }
|
|
|
| - final CpuProfile profile = new CpuProfile();
|
| + onSampleBufferChange(CpuProfile sampleBuffer) {
|
| + cpuProfileTreeElement.render();
|
| + }
|
|
|
| - 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;
|
| + onTreeConfigChange(String modeSelector, String directionSelector) {
|
| + ProfileTreeDirection direction = ProfileTreeDirection.Exclusive;
|
| + if (directionSelector != 'Up') {
|
| + direction = ProfileTreeDirection.Inclusive;
|
| + }
|
| + ProfileTreeMode mode = ProfileTreeMode.Function;
|
| + if (modeSelector == 'Code') {
|
| + mode = ProfileTreeMode.Code;
|
| + }
|
| + cpuProfileTreeElement.direction = direction;
|
| + cpuProfileTreeElement.mode = mode;
|
| cpuProfileTreeElement.render();
|
| }
|
|
|
| + Future refreshAllocationProfile() async {
|
| + return sampleBufferControlElement.reload(cls.isolate);
|
| + }
|
| +
|
| Future toggleAllocationTrace() {
|
| if (cls == null) {
|
| return new Future(refresh);
|
|
|