Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/app-logic/url-handling.js
Original file line number Diff line number Diff line change
Expand Up @@ -576,13 +576,13 @@ export function stateFromLocation(
const selectedTab =
toValidTabSlug(pathParts[selectedTabPathPart]) || 'calltree';
const sourceView: SourceViewState = {
activationGeneration: 0,
scrollGeneration: 0,
libIndex: null,
sourceFile: null,
};
const assemblyView: AssemblyViewState = {
isOpen: false,
activationGeneration: 0,
scrollGeneration: 0,
nativeSymbol: null,
allNativeSymbolsForInitiatingCallNode: [],
};
Expand Down
10 changes: 5 additions & 5 deletions src/components/app/BottomBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import classNames from 'classnames';
import { SourceView } from '../shared/SourceView';
import {
getSourceViewFile,
getSourceViewActivationGeneration,
getSourceViewScrollGeneration,
} from 'firefox-profiler/selectors/url-state';
import {
selectedThreadSelectors,
Expand All @@ -34,7 +34,7 @@ type StateProps = {|
+sourceViewSource: FileSourceStatus | void,
+globalLineTimings: LineTimings,
+selectedCallNodeLineTimings: LineTimings,
+sourceViewActivationGeneration: number,
+sourceViewScrollGeneration: number,
+disableOverscan: boolean,
|};

Expand Down Expand Up @@ -218,7 +218,7 @@ class BottomBoxImpl extends React.PureComponent<Props> {
sourceViewSource,
globalLineTimings,
disableOverscan,
sourceViewActivationGeneration,
sourceViewScrollGeneration,
selectedCallNodeLineTimings,
} = this.props;
const source =
Expand Down Expand Up @@ -253,7 +253,7 @@ class BottomBoxImpl extends React.PureComponent<Props> {
timings={globalLineTimings}
source={source}
filePath={path}
scrollToHotSpotGeneration={sourceViewActivationGeneration}
scrollToHotSpotGeneration={sourceViewScrollGeneration}
hotSpotTimings={selectedCallNodeLineTimings}
ref={this._sourceView}
/>
Expand All @@ -275,7 +275,7 @@ export const BottomBox = explicitConnect<{||}, StateProps, DispatchProps>({
globalLineTimings: selectedThreadSelectors.getSourceViewLineTimings(state),
selectedCallNodeLineTimings:
selectedNodeSelectors.getSourceViewLineTimings(state),
sourceViewActivationGeneration: getSourceViewActivationGeneration(state),
sourceViewScrollGeneration: getSourceViewScrollGeneration(state),
disableOverscan: getPreviewSelection(state).isModifying,
}),
mapDispatchToProps: {
Expand Down
8 changes: 4 additions & 4 deletions src/reducers/url-state.js
Original file line number Diff line number Diff line change
Expand Up @@ -555,13 +555,13 @@ const timelineTrackOrganization: Reducer<TimelineTrackOrganization> = (
};

const sourceView: Reducer<SourceViewState> = (
state = { activationGeneration: 0, libIndex: null, sourceFile: null },
state = { scrollGeneration: 0, libIndex: null, sourceFile: null },
action
) => {
switch (action.type) {
case 'UPDATE_BOTTOM_BOX': {
return {
activationGeneration: state.activationGeneration + 1,
scrollGeneration: state.scrollGeneration + 1,
libIndex: action.libIndex,
sourceFile: action.sourceFile,
};
Expand All @@ -573,7 +573,7 @@ const sourceView: Reducer<SourceViewState> = (

const assemblyView: Reducer<AssemblyViewState> = (
state = {
activationGeneration: 0,
scrollGeneration: 0,
nativeSymbol: null,
allNativeSymbolsForInitiatingCallNode: [],
isOpen: false,
Expand All @@ -583,7 +583,7 @@ const assemblyView: Reducer<AssemblyViewState> = (
switch (action.type) {
case 'UPDATE_BOTTOM_BOX': {
return {
activationGeneration: state.activationGeneration + 1,
scrollGeneration: state.scrollGeneration + 1,
nativeSymbol: action.nativeSymbol,
allNativeSymbolsForInitiatingCallNode:
action.allNativeSymbolsForInitiatingCallNode,
Expand Down
4 changes: 2 additions & 2 deletions src/selectors/url-state.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ export const getShowUserTimings: Selector<boolean> = (state) =>
getProfileSpecificState(state).showUserTimings;
export const getSourceViewFile: Selector<string | null> = (state) =>
getProfileSpecificState(state).sourceView.sourceFile;
export const getSourceViewActivationGeneration: Selector<number> = (state) =>
getProfileSpecificState(state).sourceView.activationGeneration;
export const getSourceViewScrollGeneration: Selector<number> = (state) =>
getProfileSpecificState(state).sourceView.scrollGeneration;
export const getShowJsTracerSummary: Selector<boolean> = (state) =>
getFullProfileSpecificState(state).showJsTracerSummary;
export const getTimelineTrackOrganization: Selector<
Expand Down
4 changes: 2 additions & 2 deletions src/types/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ export type ZippedProfilesState = {
};

export type SourceViewState = {|
activationGeneration: number,
scrollGeneration: number,
// Non-null if this source file was opened for a function from native code.
// In theory, multiple different libraries can have source files with the same
// path but different content.
Expand All @@ -264,7 +264,7 @@ export type AssemblyViewState = {|
// true even if the bottom box itself is closed.
isOpen: boolean,
// When this is incremented, the assembly view scrolls to the "hotspot" line.
activationGeneration: number,
scrollGeneration: number,
// The native symbol for which the assembly code is being shown at the moment.
// Null if the initiating call node did not have a native symbol.
nativeSymbol: NativeSymbolInfo | null,
Expand Down