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

Side by Side Diff: runtime/observatory/tests/observatory_ui/mocks/objects/sample_profile.dart

Issue 2273993002: Converted Observatory cpu-profile-table element (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Addressed comments Created 4 years, 3 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
« no previous file with comments | « runtime/observatory/tests/observatory_ui/cpu_profile_table/element_test.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 mocks; 5 part of mocks;
6 6
7 typedef M.FunctionCallTree SampleProfileMockLoadFunctionTreeCallback( 7 typedef M.FunctionCallTree SampleProfileMockLoadFunctionTreeCallback(
8 M.ProfileTreeDirection direction); 8 M.ProfileTreeDirection direction);
9 typedef M.CodeCallTree SampleProfileMockLoadCodeTreeCallback( 9 typedef M.CodeCallTree SampleProfileMockLoadCodeTreeCallback(
10 M.ProfileTreeDirection direction); 10 M.ProfileTreeDirection direction);
11 11
12 class SampleProfileMock implements M.SampleProfile { 12 class SampleProfileMock implements M.SampleProfile {
13 final SampleProfileMockLoadFunctionTreeCallback _loadFunctionTree; 13 final SampleProfileMockLoadFunctionTreeCallback _loadFunctionTree;
14 final SampleProfileMockLoadCodeTreeCallback _loadCodeTree; 14 final SampleProfileMockLoadCodeTreeCallback _loadCodeTree;
15 15
16
17 final int sampleCount; 16 final int sampleCount;
18 final int stackDepth; 17 final int stackDepth;
19 final double sampleRate; 18 final double sampleRate;
20 final double timeSpan; 19 final double timeSpan;
20 final Iterable<M.ProfileCode> codes;
21 final Iterable<M.ProfileFunction> functions;
21 22
22 M.FunctionCallTree loadFunctionTree(M.ProfileTreeDirection direction) { 23 M.FunctionCallTree loadFunctionTree(M.ProfileTreeDirection direction) {
23 if (_loadFunctionTree != null) { 24 if (_loadFunctionTree != null) {
24 return _loadFunctionTree(direction); 25 return _loadFunctionTree(direction);
25 } 26 }
26 return null; 27 return null;
27 } 28 }
28 M.CodeCallTree loadCodeTree(M.ProfileTreeDirection direction) { 29 M.CodeCallTree loadCodeTree(M.ProfileTreeDirection direction) {
29 if (_loadCodeTree != null) { 30 if (_loadCodeTree != null) {
30 return _loadCodeTree(direction); 31 return _loadCodeTree(direction);
31 } 32 }
32 return null; 33 return null;
33 } 34 }
34 35
35 SampleProfileMock({this.sampleCount: 0, this.stackDepth: 0, 36 SampleProfileMock({this.sampleCount: 0, this.stackDepth: 0,
36 this.sampleRate: 1.0, this.timeSpan: 1.0, 37 this.sampleRate: 1.0, this.timeSpan: 1.0,
38 this.codes: const [], this.functions: const [],
37 SampleProfileMockLoadFunctionTreeCallback loadFunctionTree, 39 SampleProfileMockLoadFunctionTreeCallback loadFunctionTree,
38 SampleProfileMockLoadCodeTreeCallback loadCodeTree}) 40 SampleProfileMockLoadCodeTreeCallback loadCodeTree})
39 : _loadFunctionTree = loadFunctionTree, 41 : _loadFunctionTree = loadFunctionTree,
40 _loadCodeTree = loadCodeTree; 42 _loadCodeTree = loadCodeTree;
41 } 43 }
OLDNEW
« no previous file with comments | « runtime/observatory/tests/observatory_ui/cpu_profile_table/element_test.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698