Commit Graph
15 Commits
Author SHA1 Message Date
Benedikt Meurer 6ef03671ae [wasm] Turn DebuggerLanguagePluginManager into a singleton.
The `DebuggerLanguagePluginManager` used to be per `DebuggerModel` (and
hence per target) instead of being a singleton, actually a 1-1 companion
of the `DebuggerWorkspaceBinding`. This caused a number of problems,
starting with the fact that we'd never remove raw modules (the debugging
information held inside of the extensions) that were referenced by any
target other than the "main" target. It also came with a couple of hairy
inherent race conditions, and mandated that all extensions would perform
reference counting.

This CL addresses these problems by having only a single instance of the
`DebuggerLanguagePluginManager`, which listens for targets appearing
and disappearing, and thus centralizing all the communication with the
language plugins. This reduces both the memory overhead for bookkeeping
and also addresses the race conditions when talking to the language
plugins, since all of this goes through a central bottleneck now. Also
removes the cyclic dependency between extensions/ and bindings/ modules.

Fixed: chromium:1122000
Bug: chromium:1148763
Change-Id: I0eeb4ae88bfa618c35f73c8644187423aae3bea3
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2537961
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
2020-11-17 10:02:18 +00:00
Benedikt Meurer b6e3760a13 [wasm] Add toolbar hint for UISourceCodes loaded by language plugins.
In the right bottom corner of the text editor we display a hint for
source mapped files linking back to the original URL of the script
for which the source map was loaded, but so far we didn't have the
same functionality for language plugins. This adds a message and a
link to the script URL in the same fashion.

Bug: chromium:1136484
Screenshot: https://i.imgur.com/XJU7NH9.png
Change-Id: I57e66200d93db0458d77ceb32aec9f070d8f224a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2471458
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
2020-10-15 07:32:43 +00:00
Simon Zünd cef653e7f4 [ts] Remove unnecessary @ts-nocheck from sources/ScriptOriginPlugin.js
TBR=aerotwist@chromium.org

Bug: chromium:1011811
Change-Id: I41aa9dc722aad621be2eac20ff61694c8ae32fee
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2404650
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2020-09-11 07:53:06 +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
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
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 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 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
Simon Zünd 308c74fe73 Remove SimpleView.syncToolbarItems and use async variant instead
The ScriptOriginPlugin uses source mapping to resolve a UISourceCode to
a script in order to display a toolbar item for that script. As source
mapping will be asyncified the UISourceCodeFrame needs to provide its
toolbar items in an async way.

Luckily, UI.SimpleView has both a async and non-async version for
sub-classes to provide toolbar items. This CL replaces all uses of
the non-async version with the async version and removes the
non-async version from the interface alltogether.

R=sigurds@chromium.org

Bug: chromium:1032016
Change-Id: Ifce141ccf17bbce3493cb5ffb16aa6874abfe413
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1981624
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
2020-01-16 07:18:34 +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
Tim van der Lippe 20b29c2646 Enforce newlines at end of files
Trying to upload a CL with missing newlines at the end of files fails with the following warning:

These files should end in one (and only one) newline character:

Update the ESLint config to let the linter fix these errors.

Change-Id: Ia858b5864a1dc43144e0c6d81dedbf46376c2b8d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1897679
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
2019-11-04 15:02:44 +00:00
Tim van der Lippe ad060fc2aa Fix access on undefined script object
I saw the following stacktrace while running Chromium locally:

[205430:205430:1007/182130.681774:ERROR:CONSOLE(61)] "TypeError: Cannot read property 'originStackTrace' of null TypeError: Cannot read property 'originStackTrace' of null
    at Function._script (devtools://devtools/bundled/sources/sources_module.js:1469:197)
    at Sources.ScriptOriginPlugin.rightToolbarItems (devtools://devtools/bundled/sources/sources_module.js:1467:41)
    at Sources.UISourceCodeFrame.syncToolbarItems (devtools://devtools/bundled/sources/sources_module.js:335:215)
    at Sources.SourcesView._updateScriptViewToolbarItems (devtools://devtools/bundled/sources/sources_module.js:1215:168)
    at Sources.SourcesView._editorClosed (devtools://devtools/bundled/sources/sources_module.js:1226:43)
    at Sources.TabbedEditorContainer.dispatchEventToListeners (devtools://devtools/bundled/common/Object.js:12:173)
    at Sources.TabbedEditorContainer._tabClosed (devtools://devtools/bundled/sources/sources_module.js:1012:114)
    at TabbedPane.dispatchEventToListeners (devtools://devtools/bundled/common/Object.js:12:173)
    at TabbedPane._innerCloseTab (devtools://devtools/bundled/ui/TabbedPane.js:30:73)
    at TabbedPane.closeTabs (devtools://devtools/bundled/ui/TabbedPane.js:23:93)", source: devtools://devtools/bundled/host/InspectorFrontendHost.js (61)

It appears that the code in this file already assumes that script can be
undefined, but forgot this particular case.

Change-Id: I7b0c0d34b4d16a1d29656cd8d86e3f290f8bb227
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1845751
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Auto-Submit: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#703397}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: c69e1b709eb6fae315ae8138cc4f4a05fcc0f83b
2019-10-07 19:19:25 +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
Erik Luo 17da2b7614 DevTools: linkify sourcemapped from link
Screenshot: https://imgur.com/a/UZJlAJY

Bug: none
Change-Id: I87388d3758233d7d879c801e656762de888af76d
Reviewed-on: https://chromium-review.googlesource.com/c/1387666
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Commit-Queue: Erik Luo <luoe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#620499}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: b1db902be9fe2848b8b6a15f5f5809dcb35c6956
2019-01-07 22:14:37 +00:00
Alexey Kozyatinskiy d91714258d DevTools: show origin url for anonymous scripts
R=lushnikov@chromium.org

Bug: chromium:646849
Change-Id: I8141bcdcfef7d9734ee9f1c97bfa552160fdcd9d
Reviewed-on: https://chromium-review.googlesource.com/1182865
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Reviewed-by: Andrey Lushnikov <lushnikov@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#586149}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: cc09ed9dfa66c1c27020fafe36c07601b947d2ad
2018-08-25 21:39:58 +00:00