Commit Graph
19 Commits
Author SHA1 Message Date
Tim van der Lippe 05149e9772 Remove ls from legacy-defs
This adds all missing imports for `ls` to all files. After this change,
all usages of `ls` will now properly be resolved to a LocalizedString
rather than a normal string.

R=jacktfranklin@chromium.org

No-Presubmit: True
Change-Id: Icf6d8c3b8bea1f9e66f4b6b58e4ae4c7f99e6f9c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2629554
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2021-01-15 12:53:50 +00:00
Mathias Bynens 0800d90624 Clean up redundant Promise.resolve() in ContentProviderBasedProject.js
Bug: chromium:1161501
Change-Id: I3c5f3ca3e852ba61bf46ac6caae4bbd55854dce6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2601934
Auto-Submit: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Maksim Sadym <sadym@chromium.org>
Commit-Queue: Maksim Sadym <sadym@chromium.org>
2020-12-24 07:01:37 +00:00
Tim van der Lippe e4d64e7ae0 Remove unrestricted from comments that include other annotations
For all comments that contained both the unrestricted annotation
and any other potential annotation, remove only the unrestricted
annotation.

R=szuend@chromium.org

No-Presubmit: True
Bug: 1011811
Change-Id: I27dd67f657cdb1a9233d768eea81cabe2591f5f7
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2569759
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2020-12-02 15:31:52 +00:00
Benedikt Meurer 23b85bd9ac [refactor] Reduce performance overhead of ContentProviderBasedProject.
The `ContentProviderBasedProject` is used to provide files from source
maps and language plugins, and with moderate projects that can easily
be thousands if not tens of thousands of files. We used to have two
global WeakMaps that hold the MIME type and the optional metadata per
UISourceCode, and these can grow very big (imagine the example of Earth
here with almost 6000 source files times number of workers, which can
range from 10 to 40), and V8 deals poorly with these large WeakMaps.

Another performance problem was the mapping of URLs to content
providers, which was done via a JavaScript object (presumably in
dictionary mode), which also comes with significant overhead, and
V8 does better when this is done via a Map instead.

Bug: chromium:1148713
Change-Id: Ibaa5c379aee004249bd975b9f7a714303744fbf6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2550685
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
2020-11-20 12:31:06 +00:00
Tim van der Lippe fb9ee39c41 Typecheck bindings/ContentProviderBasedProject.js with TypeScript
R=szuend@chromium.org

Bug: 1011811
Change-Id: Iba7e0c80f7ea72d8671750afa57b93deb2dd57fe
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2372391
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2020-08-26 13:29:32 +00:00
Jack Franklin 2c1e944aad Migrate front_end/bindings to devtools_entrypoint
Bug: 1101738
Change-Id: I0d43818334425984a160fa9b79076f7413a6a52b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2306155
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2020-07-20 10:47:17 +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 18f0489a60 Reland: Move ContentProvider.js and StaticContentProvider.js to text_utils.
They used to live under common.

This is to avoid the dependency from common to text_utils caused by
the method performSearchInContent.

Layout tests were disabled:
https://chromium-review.googlesource.com/c/chromium/src/+/2096995

CL to fix and re enable tests
https://chromium-review.googlesource.com/c/chromium/src/+/2096018/


Bug: 1011811
Change-Id: I76415076366d748ed0b4fe6ff32c73bae0db1312
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2097337
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-03-17 12:12:17 +00:00
Simon Zünd b4c9ea79e7 Revert "Move ContentProvider.js and StaticContentProvider.js to text_utils."
This reverts commit ba56abb36c.

Reason for revert: Breaks two layout tests:
https://ci.chromium.org/p/devtools-frontend/builders/ci/DevTools%20Linux/739

The Try bot also caught this for this CL but was green for some reason.

Original change's description:
> Move ContentProvider.js and StaticContentProvider.js to text_utils.
> They used to live under common.
> 
> This is to avoid the dependency from common to text_utils caused by the method performSearchInContent
> 
> Bug: 1011811
> Change-Id: Ic6ccb32d8c18abda7b259ca14bafca4c7c2003ab
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2090785
> Commit-Queue: Jose Leal <joselea@microsoft.com>
> Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>

TBR=joselea@microsoft.com,tvanderlippe@chromium.org

Change-Id: Ie8c99b77123e916d9f0cde73339f9cac22fff3ef
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1011811
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2095308
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2020-03-10 06:29:38 +00:00
Jose Leal Chapa ba56abb36c Move ContentProvider.js and StaticContentProvider.js to text_utils.
They used to live under common.

This is to avoid the dependency from common to text_utils caused by the method performSearchInContent

Bug: 1011811
Change-Id: Ic6ccb32d8c18abda7b259ca14bafca4c7c2003ab
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2090785
Commit-Queue: Jose Leal <joselea@microsoft.com>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-03-10 00:33:29 +00:00
Tim van der Lippe 00d4ce380f Fix usages for Common.DeferredContent typedef
This typedef could not live in `common.js`, as it was referenced in
files in common/ itself.

Bug: 1006759
Change-Id: If058bde3ab0d0ad2b2474ae522391c4f61cdfc71
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2056482
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-02-14 15:21:06 +00:00
Tim van der Lippe 55cd4ef58c Migrate bindings/ to import cross-module
Bug: 1006759
Change-Id: If69c4e96c0042e60282bf0d6450518e456a12ad1
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2017502
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-01-24 10:18:08 +00:00
Paul Lewis ef05f96d6d Migrates bindings/ to ESM internally
Bug: 1006759
Change-Id: I24fa605a4aa9dcc25cf7ff76609b8ae86cf09905
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1993350
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-01-10 11:37:56 +00:00
Tim van der Lippe c96ccd99f0 Remove unused globals
By using the script in crrev.com/c/devtools/devtools-frontend/+/1942289
we can prune all globals that are not actually global. Most of these are
internal private variables that are now module-scoped. Some variables
were also completely unused, which ESLint nicely reported.

Change-Id: I43689ac7544ad1239acc7d0eeec4dcd563d7fea9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1942290
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2019-11-29 16:38:40 +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 0723204a47 Migrate bindings/ to ESM
Bug: 1006759
Change-Id: Iaf9bc50583ed4936998f73c29c915d9c6f086195
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1847286
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#703749}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 476a2598349667b31c75170c3912dc75867883a9
2019-10-08 15:58:07 +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
Joel Einbinder ab6bef8012 DevTools: Fix flicker and dirty when saving UISourceCode for overrides
This adds a _serializedFileOperation method to IsolatedFileSystem
which waits for all pending DevTools reads/writes to finish for
a file path.

Change-Id: I5a1dd55dbe40ae0bf8335bc8e1994c1209fcc999
Reviewed-on: https://chromium-review.googlesource.com/991201
Commit-Queue: Joel Einbinder <einbinder@chromium.org>
Reviewed-by: Andrey Lushnikov <lushnikov@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#549628}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 70c0896fddc9b319eb3728438c6959c35907b35a
2018-04-10 20:23:40 +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