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

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

Issue 2204563003: Converted Observatory cpu-profile element (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Merged with master Created 4 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 unified diff | Download patch
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file
4
5 part of mocks;
6
7 typedef M.FunctionCallTree SampleProfileMockLoadFunctionTreeCallback(
8 M.ProfileTreeDirection direction);
9 typedef M.CodeCallTree SampleProfileMockLoadCodeTreeCallback(
10 M.ProfileTreeDirection direction);
11
12 class SampleProfileMock implements M.SampleProfile {
13 final SampleProfileMockLoadFunctionTreeCallback _loadFunctionTree;
14 final SampleProfileMockLoadCodeTreeCallback _loadCodeTree;
15
16
17 final int sampleCount;
18 final int stackDepth;
19 final double sampleRate;
20 final double timeSpan;
21
22 M.FunctionCallTree loadFunctionTree(M.ProfileTreeDirection direction) {
23 if (_loadFunctionTree != null) {
24 return _loadFunctionTree(direction);
25 }
26 return null;
27 }
28 M.CodeCallTree loadCodeTree(M.ProfileTreeDirection direction) {
29 if (_loadCodeTree != null) {
30 return _loadCodeTree(direction);
31 }
32 return null;
33 }
34
35 SampleProfileMock({this.sampleCount: 0, this.stackDepth: 0,
36 this.sampleRate: 1.0, this.timeSpan: 1.0,
37 SampleProfileMockLoadFunctionTreeCallback loadFunctionTree,
38 SampleProfileMockLoadCodeTreeCallback loadCodeTree})
39 : _loadFunctionTree = loadFunctionTree,
40 _loadCodeTree = loadCodeTree;
41 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698