Bug 1581249 - Revert - The timeline should show breakpoint hits. r=bhackett

This reverts commit 34ddff68bdfc54cc61252cd76e708697d1629e86.

Differential Revision: https://phabricator.services.mozilla.com/D51331

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jason Laster 2019-11-01 00:05:58 +00:00
parent 9e558efb0a
commit cd8222f74c
8 changed files with 12 additions and 45 deletions

View File

@ -231,9 +231,9 @@ export type Target = {
isContentProcess: boolean,
isWorkerTarget: boolean,
traits: Object,
chrome: boolean,
chrome: Boolean,
url: string,
isAddon: boolean,
isAddon: Boolean,
};
/**

View File

@ -32,7 +32,6 @@ type Props = {
editor: Object,
breakpointActions: BreakpointItemActions,
editorActions: EditorItemActions,
canRewind: boolean,
};
class Breakpoint extends PureComponent<Props> {
@ -119,7 +118,7 @@ class Breakpoint extends PureComponent<Props> {
};
addBreakpoint(props: Props) {
const { breakpoint, editor, selectedSource, canRewind } = props;
const { breakpoint, editor, selectedSource } = props;
const selectedLocation = getSelectedLocation(breakpoint, selectedSource);
// Hidden Breakpoints are never rendered on the client
@ -146,11 +145,7 @@ class Breakpoint extends PureComponent<Props> {
editor.codeMirror.addLineClass(line, "line", "breakpoint-disabled");
}
const isLogPoint = canRewind
? breakpoint.options.logValue != "displayName"
: breakpoint.options.logValue;
if (isLogPoint) {
if (breakpoint.options.logValue) {
editor.codeMirror.addLineClass(line, "line", "has-log");
} else if (breakpoint.options.condition) {
editor.codeMirror.addLineClass(line, "line", "has-condition");

View File

@ -6,11 +6,7 @@
import React, { Component } from "react";
import Breakpoint from "./Breakpoint";
import {
getSelectedSource,
getFirstVisibleBreakpoints,
getCanRewind,
} from "../../selectors";
import { getSelectedSource, getFirstVisibleBreakpoints } from "../../selectors";
import { makeBreakpointId } from "../../utils/breakpoint";
import { connect } from "../../utils/connect";
import { breakpointItemActions } from "./menus/breakpoints";
@ -35,7 +31,6 @@ type Props = {
editor: Object,
breakpointActions: BreakpointItemActions,
editorActions: EditorItemActions,
canRewind: boolean,
};
class Breakpoints extends Component<Props> {
@ -47,7 +42,6 @@ class Breakpoints extends Component<Props> {
editor,
breakpointActions,
editorActions,
canRewind,
} = this.props;
if (!selectedSource || !breakpoints || selectedSource.isBlackBoxed) {
@ -66,7 +60,6 @@ class Breakpoints extends Component<Props> {
editor={editor}
breakpointActions={breakpointActions}
editorActions={editorActions}
canRewind={canRewind}
/>
);
})}
@ -81,7 +74,6 @@ export default connect<Props, OwnProps, _, _, _, _>(
// breakpoint marker represents only the first breakpoint
breakpoints: getFirstVisibleBreakpoints(state),
selectedSource: getSelectedSource(state),
canRewind: getCanRewind(state),
}),
dispatch => ({
breakpointActions: breakpointItemActions(dispatch),

View File

@ -26,14 +26,13 @@ type Props = {
source: Source,
columnBreakpoint: ColumnBreakpointType,
breakpointActions: BreakpointItemActions,
canRewind: boolean,
};
const breakpointButton = document.createElement("button");
breakpointButton.innerHTML =
'<svg viewBox="0 0 11 13" width="11" height="13"><path d="M5.07.5H1.5c-.54 0-1 .46-1 1v10c0 .54.46 1 1 1h3.57c.58 0 1.15-.26 1.53-.7l3.7-5.3-3.7-5.3C6.22.76 5.65.5 5.07.5z"/></svg>';
function makeBookmark({ breakpoint }, { onClick, onContextMenu, canRewind }) {
function makeBookmark({ breakpoint }, { onClick, onContextMenu }) {
const bp = breakpointButton.cloneNode(true);
const isActive = breakpoint && !breakpoint.disabled;
@ -41,11 +40,9 @@ function makeBookmark({ breakpoint }, { onClick, onContextMenu, canRewind }) {
const condition = breakpoint && breakpoint.options.condition;
const logValue = breakpoint && breakpoint.options.logValue;
const isLogPoint = canRewind ? logValue != "displayName" : logValue;
bp.className = classnames("column-breakpoint", {
"has-condition": condition,
"has-log": isLogPoint,
"has-log": logValue,
active: isActive,
disabled: isDisabled,
});
@ -64,7 +61,7 @@ export default class ColumnBreakpoint extends PureComponent<Props> {
bookmark: ?Bookmark;
addColumnBreakpoint = (nextProps: ?Props) => {
const { columnBreakpoint, source, canRewind } = nextProps || this.props;
const { columnBreakpoint, source } = nextProps || this.props;
const sourceId = source.id;
const doc = getDocument(sourceId);
@ -76,7 +73,6 @@ export default class ColumnBreakpoint extends PureComponent<Props> {
const widget = makeBookmark(columnBreakpoint, {
onClick: this.onClick,
onContextMenu: this.onContextMenu,
canRewind,
});
this.bookmark = doc.setBookmark({ line: line - 1, ch: column }, { widget });

View File

@ -12,7 +12,6 @@ import {
getSelectedSource,
visibleColumnBreakpoints,
getContext,
getCanRewind,
} from "../../selectors";
import { connect } from "../../utils/connect";
import { makeBreakpointId } from "../../utils/breakpoint";
@ -32,7 +31,6 @@ type Props = {
selectedSource: ?Source,
columnBreakpoints: ColumnBreakpointType[],
breakpointActions: BreakpointItemActions,
canRewind: boolean,
};
class ColumnBreakpoints extends Component<Props> {
@ -45,7 +43,6 @@ class ColumnBreakpoints extends Component<Props> {
columnBreakpoints,
selectedSource,
breakpointActions,
canRewind,
} = this.props;
if (
@ -66,7 +63,6 @@ class ColumnBreakpoints extends Component<Props> {
editor={editor}
source={selectedSource}
breakpointActions={breakpointActions}
canRewind={canRewind}
/>
));
});
@ -78,7 +74,6 @@ const mapStateToProps = state => ({
cx: getContext(state),
selectedSource: getSelectedSource(state),
columnBreakpoints: visibleColumnBreakpoints(state),
canRewind: getCanRewind(state),
});
export default connect<Props, OwnProps, _, _, _, _>(

View File

@ -32,7 +32,6 @@ import {
getActiveSearch,
getSelectedLocation,
getSelectedSourceWithContent,
getCanRewind,
getConditionalPanelLocation,
getSymbols,
getIsPaused,
@ -111,7 +110,6 @@ export type Props = {
isPaused: boolean,
skipPausing: boolean,
inlinePreviewEnabled: boolean,
canRewind: boolean,
// Actions
openConditionalPanel: typeof actions.openConditionalPanel,
@ -425,7 +423,6 @@ class Editor extends PureComponent<Props, State> {
const {
cx,
selectedSource,
canRewind,
conditionalPanelLocation,
closeConditionalPanel,
addBreakpointAtLine,
@ -460,9 +457,7 @@ class Editor extends PureComponent<Props, State> {
return continueToHere(cx, sourceLine);
}
const shouldLog = ev.altKey || canRewind;
return addBreakpointAtLine(cx, sourceLine, shouldLog, ev.shiftKey);
return addBreakpointAtLine(cx, sourceLine, ev.altKey, ev.shiftKey);
};
onGutterContextMenu = (event: MouseEvent) => {
@ -696,7 +691,6 @@ const mapStateToProps = state => {
isPaused: getIsPaused(state, getCurrentThread(state)),
skipPausing: getSkipPausing(state),
inlinePreviewEnabled: getInlinePreview(state),
canRewind: getCanRewind(state),
};
};

View File

@ -54,7 +54,7 @@ export type CallDeclaration = SymbolDeclaration & {
};
export type MemberDeclaration = SymbolDeclaration & {
computed: boolean,
computed: Boolean,
expression: string,
};

View File

@ -118,12 +118,8 @@ BreakpointActor.prototype = {
}
);
}
// Treat `displayName` breakpoints as standard breakpoints
if (options.logValue != "displayName") {
return;
}
}
// In all other cases, this is used as a script breakpoint handler.
// Clear any existing handler first in case this is called multiple times
@ -224,8 +220,7 @@ BreakpointActor.prototype = {
}
}
// Replay logpoints are handled in _newOffsetsOrOptions
if (logValue && !this.threadActor.dbg.replaying) {
if (logValue) {
return logEvent({
threadActor: this.threadActor,
frame,