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>
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>
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>
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
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