Commit Graph
31 Commits
Author SHA1 Message Date
Tim van der Lippe d1a00aacb9 [globals] self.UI.context
R=jacktfranklin@chromium.org

Bug: 1058320
Change-Id: Icc1d806782e7624fff02e719670a2cca59070ddd
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2364594
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-08-19 16:24:38 +00:00
Eric Leese e794555edb Deduplicate source mapped breakpoint
Fixes UI bug where a source mapped breakpoint in multiple workers
will show multiple times in the sidebar even though there is no
distinction either in their text or the result of disabling them.

Bug: chromium:1105764
Change-Id: I0b7cb58d8e7814b4f68c1bc39960d51b7f0598d3
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2336719
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Eric Leese <leese@chromium.org>
2020-08-05 09:00:16 +00:00
Jan Scheffler e1a1b0fbbf Migrate front_end/sources to devtools_entrypoint
R=aerotwist@chromium.org, jacktfranklin@chromium.org

Bug: 1101738
Change-Id: I79bcbb35ccf48f6336cde80858f0177427703795
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2332224
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Auto-Submit: Jan Scheffler <janscheffler@chromium.org>
2020-07-31 14:33:20 +00:00
Julian Geppert 34a77b7e7c Feature: Disable breakpoints in file
Adds the option to disable all breakpoints in a file to the context menu when right-clicking on a breakpoint.
demo: https://imgur.com/a/nl0v1mk

Bug: 1084204
Change-Id: I065ef6766f013a6b58c9c064f02e71fe380769cd
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2232947
Reviewed-by: Wolfgang Beyer <wolfi@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Wolfgang Beyer <wolfi@chromium.org>
2020-06-15 13:32:17 +00:00
Benedikt Meurer 6380ab5a1d [wasm] Display UI locations with hexadecimal pc offsets.
Following the guidelines in [1] we use hexadecimal pc offsets
to display source locations in Wasm modules instead of the line
based locations we use for JavaScript and other text formats.
This pc offset is encoded in the `columnNumber` field (and the
`lineNumber` field is zero) for Wasm locations.

We make the distinction based on the MIME type of the associated
`UISourceCode`, which in case of Wasm is 'application/wasm'.

This partially repairs the Breakpoint view, which is a bit weird
after https://crrev.com/c/2220098 landed before, and also removes
the weird base64 encoded Wasm bytecode from the Breakpoint view.
We can later look into restoring the display of the Wasm bytecode
instruction if that's really an important feature.

[1]: https://github.com/WebAssembly/design/blob/master/Web.md

Bug: chromium:1071432
Fixed: chromium:1090256
Change-Id: I3e0e774ad8e77a7e1ea6e021887d9fda7785747a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2226558
Reviewed-by: Eric Leese <leese@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
2020-06-02 16:42:20 +00:00
Sigurd Schneider 7b92165625 Convert TextUtils.ContentProvider.DeferredContent to tagged union
This actually discovered a bug in the implementation of
JavaScriptBreakpointsSidebarPane where the error condition
wasn't checked.

Bug: chromium:1011811, chromium:1079233
Change-Id: Ic2f3c990a587aa7077edd26a2445789355ebe0a4
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2194877
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
2020-05-19 13:16:36 +00:00
Tim van der Lippe f49e23286b Replace single class invocations of createElementWithClass
This applies the following replacement to the codebase:

(\S+) = createElementWithClass\('(\w+)', '([^'\s]+)'\);

to

$1 = document.createElement('$2');\n$1.classList.add('$3');

R=aerotwist@chromium.org

No-Presubmit: true
Bug: 1011811, 1077215
Change-Id: I0d76b39f1ed8cd4a44f18f94e398db934ba4b09c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2176112
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-05-01 16:54:52 +00:00
Alex Rudenko bbb839e1e6 Prevent complete DOM update for breakpoints sidebar when debugging
This CL introduces partial list update mechanism when the number of
breakpoints in the sidebar panel remains the same. In this case,
the component will detect if there were any changes in the breakpoints
and it will update only the changed breakpoints. This change speeds
up the step navigation in the debugger.

Before: https://i.imgur.com/8ed4258.png
After: https://i.imgur.com/aveakGL.png

Bug: 1069694
Change-Id: Iff420b4edef7b3505d2e3662c6bea261f970dd34
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2160939
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
2020-04-23 18:26:00 +00:00
Peter Marshall a80ca2e088 [sources] Cache line ending information to speed up stepping
We re-create the whole breakpoints side panel every time we step,
including the display of all the breakpoints even if they don't change.
One expensive part of doing this is calculating a preview of the source
line for which the breakpoint is set. To do this we need to search the
source file for all line endings, which on very large files can be
very expensive.

Line endings are currently cached on the TextUtils.Text.Text object.
We never get a chance to use this cached information though, because
the whole _breakpoints ListModel is re-created from a new data model
on each update, which we trigger on every Step.

Ideally we would only regenerate the UI that actually changed which
would avoid this recalculation on every step, but that is a bigger
change that I'm not confident we can make right now without potentially
breaking something.

Instead, when (re)creating the breakpoint items for the ListModel,
create and share the Text item between multiple breakpoints within the
same source file. Now we do O(files with breakpoints set) line-ending
calculations instead of O(breakpoints set).

This would still be very slow if you had hundreds of large files with
one breakpoint set in each, but I assume that is a way less common
scenario.

Line ending calculation is only about 50% of the cost of stepping at
the moment, so this speeds up by a factor of 2x but still leaves more
work to do (see screenshots of performance trace).

Before: https://imgur.com/a/qOYHi3u
After: https://imgur.com/a/8ydiuLO

Bug: 1069694

Change-Id: I8d8baf955ef71ab12dc85d5e8103a8bf598ba7da
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2156351
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2020-04-22 09:59:34 +00:00
Paul Lewis 75c7d0decc [global] Remaps self.UI.viewManager
Moves self.UI.viewManager to an instance() method.

Bug: 1058320
Change-Id: I0c444101da59ba9eba4745d1dc551bb8906a0a4f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2107624
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-03-19 12:39:32 +00:00
Paul Lewis 59642a6ea9 [global] Remaps self.Bindings.breakpointManager
Moves self.Bindings.breakpointManager to an instance() method.

Bug: 1058320
Change-Id: If123cdb552e28dc7e85079aef0176a729cd5ff9f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2107535
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-03-18 15:26:18 +00:00
Paul Lewis 23883e36f5 [global] Remaps self.Bindings.debuggerWorkspaceBinding
Moves self.Bindings.debuggerWorkspaceBinding to an instance() method.

Bug: 1058320
Change-Id: Id9090073eb4a0b8715bba82ded470d15d718dcc6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2107529
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-03-18 12:06:08 +00:00
Paul Lewis 2d7d65c5e8 [global] Remaps self.Common.settings
This CL changes references to self.Common.settings (the global
instance of SDK.Common.Settings) over to
Common.Settings.Settings.instance(). To keep both TypeScript and
Closure happy we must make a method on the Settings class itself,
since it only allows private constructors to be accessed by static
methods on the class.

Bug: 1058320
Change-Id: I04afc8caf64acf29cdda13ef03ad05cfff4786a1
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2091450
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-03-16 22:04:07 +00:00
Simon Zünd 3cb141bbce Prepare various files for asynchronous source mapping
Asynchronous source mapping requires us to properly await calls to
{rawLocationToUILocation}.

R=sigurds@chromium.org

Bug: chromium:1032016
Change-Id: I89a072a0d6dcb470411b27ad40949a8cb0b5cfa5
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2071882
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
2020-02-26 15:12:35 +00:00
Tim van der Lippe e2418436c0 Remove typedefs from {source_frame,sources,text_editor,text_utils}-legacy.js
Bug: 1006759
Change-Id: I4c972b7714850b2c7064a1dc9ab5b675be5d5917
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2056849
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-02-18 14:16:57 +00:00
Tim van der Lippe fbbf981a34 Migrate sources/ to import cross-module
Bug: 1006759
Change-Id: I9b91ba0c24a14ca4d30cf3dd4469d5e162bc96db
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2054548
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-02-13 17:11:00 +00:00
Paul Lewis d990734442 [Global] Update refs to UI.context
Bug: 1006759
Change-Id: I4a405fb1d80f6a384a311a3482c37f943238b73f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2019137
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-01-24 14:25:48 +00:00
Paul Lewis 50993696be [Global] Update refs to UI.viewManager & UI.zoomManager
Bug: 1006759
Change-Id: Iebf11153861850acbbfef9f40e3552d1be9a6460
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2016760
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-01-23 15:45:11 +00:00
Paul Lewis 2ddc6313de [Global] Updates refs for bindings globals
Bug: 1006759
Change-Id: Ib73c3ce4b014126da088851bfeccdff49d6ba0ea
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2016754
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-01-23 13:37:40 +00:00
Paul Lewis 4b64b3f263 [Global] Remap refs to Common.moduleSetting
Bug: 1006759
Change-Id: Ia45ef0fd0b97588ca23a8d784c0564050b0bbf4c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2016748
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-01-23 12:00:20 +00:00
Paul Lewis 39944955e0 Migrates sources/ to ESM internally
Bug: 1006759
Change-Id: Ie1ca01eaadde94191431217f297b108dde5e8adf
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2002596
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-01-22 17:15:48 +00:00
Jack Lynch 6790102aae Make javascript breakpoints accessible
This change makes the javascript breakpoints pane accessible by:
- adding an option to the context menu to reveal the location of a
breakpoint for keyboard users
- allowing keyboard users to navigate the breakpoints list with the
arrow keys by refactoring the pane to use UI.ListControl, in response to
feedback on [1]
- putting the checked/unchecked status of a breakpoint and whether it
has been hit in its aria-describedby

These changes break a few web tests, so [2] must be merged first to
disable them. Test fixes are here [3].

Screenshots:

Context menu: https://gyazo.com/3f54dd9a1fd146270a64afd635cf2bc6
Hit breakpoint: https://gyazo.com/8363b986f36f67a213170dad73ba0450

Keyboard navigation video: https://i.imgur.com/ZOvVrxf.mp4

[1] https://chromium-review.googlesource.com/c/chromium/src/+/1644461/14/third_party/blink/renderer/devtools/front_end/browser_debugger/DOMBreakpointsSidebarPane.js#141
[2] https://chromium-review.googlesource.com/c/chromium/src/+/1894751
[3] https://chromium-review.googlesource.com/c/chromium/src/+/1636716

Bug: 963183
Change-Id: I360c828145806a1133937ce8c6f2e4885cb0f900
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1891267
Commit-Queue: Jack Lynch <jalyn@microsoft.com>
Reviewed-by: Brandon Goddard <brgoddar@microsoft.com>
Reviewed-by: Robert Paveza <Rob.Paveza@microsoft.com>
2020-01-07 20:56:48 +00:00
Tim van der Lippe 8987f8f14e Migrate sources/ to ESM
Bug: 1006759
Change-Id: I509e05a6e4f4c974dbcdd8224f0439d7b1b98aec
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1985672
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-01-06 12:57:13 +00:00
Rob Paveza 2eb8c14505 DevTools: Display error when source file can't load
The source editor, when it cannot load a particular file, will simply
display a blank file instead. At the bottom, this is because the APIs
used to load the files do not have a way to propagate an error up to
the call site. Rather, the callback either is never called, or is
called with just an empty string.

This refactor changes the way the project system loads file contents
by replacing the callback model with a Promise-based model. However,
in this version, rather than propagating an error (handled via
catch), the error is exposed as a property on the object passed via
the the load functions. Although it might be preferable to use
async throw/catch, because there are ~4-5 layers of redirection
through the project system, the added complexity seems to not really
justify that work. I'm open to reconsidering this design, though.

Attempting to load a file via file:// which does not exist previously
produced no error because the DevToolsUIBindings handler would just
always resolve with no content and HTTP status 200. I had previously
addressed that bug in this changeset, but I've split it out to
https://chromium-review.googlesource.com/c/chromium/src/+/1847833 .

Sample "after" screenshot: https://imgur.com/a/tlm90sg

Bug: 961940
Bug: 941035

Change-Id: If121611090e9c35eeb1de162b59f8a9f72f696d9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1817677
Reviewed-by: Lorne Mitchell <lomitch@microsoft.com>
Reviewed-by: Jeff Fisher <jeffish@microsoft.com>
Commit-Queue: Lorne Mitchell <lomitch@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#705438}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 61ec2a233d9a7bf4bb4b3e610de6fc233ae0d46e
2019-10-13 18:02:38 +00:00
Tim van der Lippe e3595942b0 Migrate platform/ to ESM
- Change Multimap to Platform.Multimap
- Importscripts in workers. This means that the file does not export any
utilities, but we will need to clean that up later.

Bug: 1006759
Change-Id: I91d45febebfc597f0d0b5c6a017c26f6b12b84b4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1832218
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#702111}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: d704d799ac695e03ef367102c2a870e4a5f239e9
2019-10-02 18:15:32 +00:00
Tim van der Lippe 1d6e57a0e3 Always add braces to single-line if-statements
The Chromium/Google style guides does not enforce curly braces for
single-line if-statements, but does strongly recommend doing so. Adding
braces will improve code readability, by visually separating code
blocks. This will also prevent issues where accidental additions are
pushed to the "else"-clause instead of in the if-block.

This CL also updates the presubmit `eslint` to run the fix with the
correct configuration. It will now fix all issues it can fix.

Change-Id: I4b616f21a99393f168dec743c0bcbdc7f5db04a9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1821526
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Jeff Fisher <jeffish@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#701070}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 7e0bdbe2d7f9fc2386bfaefda3cc29c66ccc18f9
2019-09-30 11:55:34 +00:00
Tim van der Lippe ffa7862d4e Update Closure compiler to v20190729
The new compiler caught a lot of pre-existing issues in the codebase.
Sadly, the old compiler version was not smart enough to understand the
new changes. Therefore, the changes have be included in the same CL as
the compiler update.

Most of the changes are related to better handling of prototype and
class inheritance, as well as handling of null/undefined tracking.

Change-Id: I3941a3a240a4d09c4945e1e20d2521090ef837c9
Bug: 991710
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1762081
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@google.com>
Auto-Submit: Tim van der Lippe <tvanderlippe@google.com>
Cr-Original-Commit-Position: refs/heads/master@{#696761}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: ca93474213278e32e36d6ace1474c56884030757
2019-09-16 12:07:12 +00:00
Joel Einbinder 0745b105f2 DevTools: Show columns in the JavaScript breakpoint sidebar
Multiple active inline breakpoints now each get their own entry in
the breakpoints sidebar. The column is shown for every breakpoint after
the first that share a line.

https://i.imgur.com/BoLyzYv.png

Bug: 927961

Change-Id: If07ca26b177bf8fa82c7bf969397101485210c01
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1449152
Commit-Queue: Joel Einbinder <einbinder@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#647509}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 43005f59158e79ce01f4bfa77ea52b9732fc7a4d
2019-04-03 22:43:58 +00:00
Alexey Kozyatinskiy c705d87233 [DevTools] breakpoint manager should use only live locations
Without this CL breakpoints manager listens for UISourceCodeRemoved
and ProjectRemoved events to reset locations when UISourceCode is gone.
It should use live locations instead.

Drive-by: fixed bug with breakpoints when UISourceCode with formatted
source is gone.

R=lushnikov@chromium.org

Bug: none
Change-Id: I3d23ff9e1ba7452d5e005cbc74e27119cda6eac7
Reviewed-on: https://chromium-review.googlesource.com/1178223
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Reviewed-by: Andrey Lushnikov <lushnikov@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#583891}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 89a6d413f8be13918811a13e835db75caa71c2c3
2018-08-17 00:01:17 +00:00
Alexey Kozyatinskiy 0c7b1a30c0 [DevTools] simplify BreakpointManager interface
Removed couple public methods and simplified map of map of map.

R=lushnikov@chromium.org

Bug: none
Change-Id: Iac8b88478f9b7b7c4b722c2f65b723b7094559e4
Reviewed-on: https://chromium-review.googlesource.com/1176291
Reviewed-by: Andrey Lushnikov <lushnikov@chromium.org>
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#583404}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: a17f963eda6a5f5ac896d7456632b58f0753783b
2018-08-15 21:32:04 +00:00
Blink Reformat 4c46d0969f The Great Blink mv for source files, part 2.
Move and rename files.

NOAUTOREVERT=true
NOPRESUBMIT=true
NOTREECHECKS=true
Bug: 768828
TBR=darin@chromium.org
NOTRY=true

Change-Id: I66d3b155808bc5bdbf237b80208e1e552bcf7f28
Reviewed-on: https://chromium-review.googlesource.com/1001153
Reviewed-by: Blink Reformat <blink-reformat@chromium.org>
Commit-Queue: Blink Reformat <blink-reformat@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#549061}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 0aee4434a4dba42a42abaea9bfbc0cd196a63bc1
2018-04-07 15:32:37 +00:00