| OLD | NEW |
| (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 } |
| OLD | NEW |