@@ -19,11 +19,13 @@ import {
19
19
getInnerWindowIDToPageMap ,
20
20
getProfileUsesMultipleStackTypes ,
21
21
} from '../../selectors/profile' ;
22
- import { selectedThreadSelectors } from '../../selectors/per-thread' ;
23
22
import {
23
+ getStackChartSameWidths ,
24
24
getShowUserTimings ,
25
25
getSelectedThreadsKey ,
26
- } from '../../selectors/url-state' ;
26
+ } from 'firefox-profiler/selectors/url-state' ;
27
+ import type { StackTimingByDepth } from 'firefox-profiler/profile-logic/stack-timing' ;
28
+ import { selectedThreadSelectors } from '../../selectors/per-thread' ;
27
29
import { getTimelineMarginLeft } from '../../selectors/app' ;
28
30
import { StackChartEmptyReasons } from './StackChartEmptyReasons' ;
29
31
import { ContextMenuTrigger } from '../shared/ContextMenuTrigger' ;
@@ -70,6 +72,7 @@ type StateProps = {|
70
72
+ weightType : WeightType ,
71
73
+ innerWindowIDToPageMap : Map < InnerWindowID , Page > | null ,
72
74
+ combinedTimingRows : CombinedTimingRows ,
75
+ + stackTimingRows : StackTimingByDepth ,
73
76
+ timeRange : StartEndRange ,
74
77
+ interval : Milliseconds ,
75
78
+ previewSelection : PreviewSelection ,
@@ -84,6 +87,7 @@ type StateProps = {|
84
87
+ timelineMarginLeft : CssPixels ,
85
88
+ displayStackType : boolean ,
86
89
+ hasFilteredCtssSamples : boolean ,
90
+ + stackChartSameWidths : boolean ,
87
91
| } ;
88
92
89
93
type DispatchProps = { |
@@ -205,6 +209,7 @@ class StackChartImpl extends React.PureComponent<Props> {
205
209
thread,
206
210
threadsKey,
207
211
combinedTimingRows,
212
+ stackTimingRows,
208
213
timeRange,
209
214
interval,
210
215
previewSelection,
@@ -221,6 +226,7 @@ class StackChartImpl extends React.PureComponent<Props> {
221
226
timelineMarginLeft,
222
227
displayStackType,
223
228
hasFilteredCtssSamples,
229
+ stackChartSameWidths,
224
230
} = this . props ;
225
231
226
232
const maxViewportHeight = combinedTimingRows . length * STACK_FRAME_HEIGHT ;
@@ -262,6 +268,7 @@ class StackChartImpl extends React.PureComponent<Props> {
262
268
innerWindowIDToPageMap,
263
269
threadsKey,
264
270
combinedTimingRows,
271
+ stackTimingRows,
265
272
getMarker,
266
273
// $FlowFixMe Error introduced by upgrading to v0.96.0. See issue #1936.
267
274
updatePreviewSelection,
@@ -279,6 +286,7 @@ class StackChartImpl extends React.PureComponent<Props> {
279
286
scrollToSelectionGeneration,
280
287
marginLeft : timelineMarginLeft ,
281
288
displayStackType : displayStackType ,
289
+ stackChartSameWidths,
282
290
} }
283
291
/>
284
292
</ div >
@@ -292,14 +300,17 @@ class StackChartImpl extends React.PureComponent<Props> {
292
300
export const StackChart = explicitConnect < { || } , StateProps , DispatchProps > ( {
293
301
mapStateToProps : ( state ) => {
294
302
const showUserTimings = getShowUserTimings ( state ) ;
303
+ const stackTimingRows =
304
+ selectedThreadSelectors . getStackTimingByDepth ( state ) ;
295
305
const combinedTimingRows = showUserTimings
296
306
? selectedThreadSelectors . getCombinedTimingRows ( state )
297
- : selectedThreadSelectors . getStackTimingByDepth ( state ) ;
307
+ : stackTimingRows ;
298
308
299
309
return {
300
310
thread : selectedThreadSelectors . getFilteredThread ( state ) ,
301
311
// Use the raw WeightType here, as the stack chart does not use the call tree
302
312
weightType : selectedThreadSelectors . getSamplesWeightType ( state ) ,
313
+ stackTimingRows,
303
314
combinedTimingRows,
304
315
timeRange : getCommittedRange ( state ) ,
305
316
interval : getProfileInterval ( state ) ,
@@ -319,6 +330,7 @@ export const StackChart = explicitConnect<{||}, StateProps, DispatchProps>({
319
330
displayStackType : getProfileUsesMultipleStackTypes ( state ) ,
320
331
hasFilteredCtssSamples :
321
332
selectedThreadSelectors . getHasFilteredCtssSamples ( state ) ,
333
+ stackChartSameWidths : getStackChartSameWidths ( state ) ,
322
334
} ;
323
335
} ,
324
336
mapDispatchToProps : {
0 commit comments