This fixes the character encoding of the UrlString returned by
`urlsFromParentUrlAndName()`, which is called by `WorkspaceImpl`'s
`renameUISourceCode()`, to match the encoding of filenames as they are
received via `fileSystemFilesChangedAddedRemoved()` from the backend.
Without a matching encoding, the UISourceCode will not be found when
looking it up by URL, which in turn leads to the creation of an
additional duplicate UISourceCode.
Fixed: 1320717
Change-Id: I39a6bda366da3ee681a77f28bb1ad3bcccc86fa5
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3613869
Reviewed-by: Simon Zünd <szuend@chromium.org>
Reviewed-by: Eric Leese <leese@chromium.org>
Commit-Queue: Wolfgang Beyer <wolfi@chromium.org>
This is a reland of commit 1b596f3b4b.
Changes:
1. Gated behind an experiment
2. Removed changes that are currently not used since it's gated
(i.e. test changes)
Original change's description:
> Enable synchronization on instrumentation breakpoints
>
> This CL introduces the synchronization point for setting
> breakpoints on new scripts using instrumentation breakpoints.
>
> Instrumentation breakpoints will trigger at the first statement
> of a newly run script. Afterwards we wait for all resources
> that we need to set a breakpoint (if one is cached for that
> particular script), set it, and resume.
>
> Note: this will not correctly synchronize the case where we
> just opened DevTools or just created a new target, as at this
> point some scripts might have started running. For this, we
> need to synchronize the Debugger.enable call, which is something
> that is left to take care of.
>
> Bug: chromium:1229541, chromium:1133307, chromium:1300509
> Change-Id: I44e9b053a7cf64cc1f477a68ce9389cd92a1d05d
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3470237
> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
> Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
> Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
Bug: chromium:1229541, chromium:1133307, chromium:1300509
Change-Id: I19553ddac9530fa3ccac6b245a3dd89da88c6d51
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3542248
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
This reverts commit 1b596f3b4b.
Reason for revert: closed the tree, more blink tests to adapt
Original change's description:
> Enable synchronization on instrumentation breakpoints
>
> This CL introduces the synchronization point for setting
> breakpoints on new scripts using instrumentation breakpoints.
>
> Instrumentation breakpoints will trigger at the first statement
> of a newly run script. Afterwards we wait for all resources
> that we need to set a breakpoint (if one is cached for that
> particular script), set it, and resume.
>
> Note: this will not correctly synchronize the case where we
> just opened DevTools or just created a new target, as at this
> point some scripts might have started running. For this, we
> need to synchronize the Debugger.enable call, which is something
> that is left to take care of.
>
> Bug: chromium:1229541, chromium:1133307, chromium:1300509
> Change-Id: I44e9b053a7cf64cc1f477a68ce9389cd92a1d05d
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3470237
> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
> Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
> Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
Bug: chromium:1229541, chromium:1133307, chromium:1300509
Change-Id: I9eccdf065820854746ec7ad4643362859c9960e4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3506653
Auto-Submit: Kim-Anh Tran <kimanh@chromium.org>
Reviewed-by: Johan Bay <jobay@chromium.org>
Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
Owners-Override: Kim-Anh Tran <kimanh@chromium.org>
This CL introduces the synchronization point for setting
breakpoints on new scripts using instrumentation breakpoints.
Instrumentation breakpoints will trigger at the first statement
of a newly run script. Afterwards we wait for all resources
that we need to set a breakpoint (if one is cached for that
particular script), set it, and resume.
Note: this will not correctly synchronize the case where we
just opened DevTools or just created a new target, as at this
point some scripts might have started running. For this, we
need to synchronize the Debugger.enable call, which is something
that is left to take care of.
Bug: chromium:1229541, chromium:1133307, chromium:1300509
Change-Id: I44e9b053a7cf64cc1f477a68ce9389cd92a1d05d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3470237
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
One can change the file type of a file in the local overrides folder by
renaming the file. Such a rename can cause a different viewer to be
more appropriate for handling this file (e.g. when renaming a html-file
into a jpg, the file should now be handled by an image viewer). This CL
makes sure that in this scenario, the existing editor tab is closed and
a new one with an editor of the correct type is opened.
Unsaved changes in the file are not lost and it is ensured that there
is no unnecessary dialog popping up with a warning about external
changes to the file.
Bug: 1297532
Change-Id: I95098e15455c2ca328be00515941fe0950e5e3e0
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3468521
Reviewed-by: Danil Somsikov <dsv@chromium.org>
Commit-Queue: Wolfgang Beyer <wolfi@chromium.org>
DevTools startup has slowed down a bit over the last year. The main
suspect that we have is the amount of files that are loaded at startup.
We have historically made significant improvements by removing file
loading out of the critical path, for example by removing the `module.json`
files from various modules. These have all attributed to improvements.
For our shell, we were still loading these legacy files. However, now
that we are fully type-checked with TypeScript, we have for the most part
removed our reliance on globals. There are only a handful of places where
we still rely on globals, most notably `MainImpl` for instantiation of
singletons and a single declaration in `ui/legacy/Panel.ts` which sets
values on `UI.panels`. Other than that, there don't appear to be anymore
usages of globals.
Therefore, we can move these legacy files out of our main shell and into
the legacy_test_runner. Doing so, our production build will now include
fewer files and hopefully also boot faster, while we still load the
legacy files for our layout tests (which still rely on globals).
It isn't clear what the performance impact will be, but cleaning this up
is good and we are relatively confident this will alleviate at least
some of the performance problems that have been reported.
R=yangguo@chromium.org
Bug: none
Change-Id: Ie34fbf6b82f3d1ba11bed623a9cc3d2a03c4c0c7
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3264212
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
This changes updates the Linkifier with an option to include the column
number in the link text if available. Also taking the opportunity to
remove some run-time type checks that are no longer needed thanks to the
TypeScript migration.
Including the column number in source links helps developers who are
looking at a performance profile "offline" find the function that was
called within the source file. When only a line number is given, this
is more difficult, especially for minified JavaScript files where there
may be many function definitions on the same line.
Bug: 1252049
Change-Id: I1e33583010c8f5d62789e4341ca5b4f6b2c9cd58
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3176625
Commit-Queue: Brandon Walderman <brwalder@microsoft.com>
Reviewed-by: Robert Paveza <Rob.Paveza@microsoft.com>
Reviewed-by: Simon Zünd <szuend@chromium.org>
This CL adds types for host bindings events that go in the direction of
"Chromium backend -> DevTools frontend". There is already a
similar structure called `EventDescriptors` that fufills a different
purpose. `EventDescriptors` is used to translate the host binding
event parameters, that arrive in an array, to `EventTarget` events,
that are objects with a single "data" property. `EventDescriptors`
doesn't contain any type information for the event parameters and
it is used at runtime. The new `EventTypes` type on the other hand
only contains type information and is not used at runtime.
Please note that `EventTypes` can't be used to check the "dispatch"
side, as the event translation + dispatch happens in a dynamic
fashion.
R=pfaffe@chromium.org
Bug: 1228674
Change-Id: I1dbe6ba6b0a494963bf443f25dedc860fa3e28e1
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3171012
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
This requires us using the environment, as the SourceFormatter relies
on numerous singletons related to workspaces, projects and documents.
This CL gets us to about 50% code coverage. The missing coverage is
mostly in the two mapping classes at the end of the file, which are
more difficult to test. We will do that in a follow-up CL.
R=szuend@chromium.org
Bug: 1009443
Change-Id: I8412b5f6e8053d72cea5110a3b82458388fb9e95
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3056378
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>