Commit Graph
29 Commits
Author SHA1 Message Date
Tim van der Lippe 5e1aeb0577 Remove suppress annotations
All of these were Closure-specific.

R=szuend@chromium.org

No-Presubmit: True
Bug: 1011811
Change-Id: Ia580e21cd3b06f532bb5a63a770ccfa3d7c796ee
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2569761
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2020-12-02 17:27:02 +00:00
Tim van der Lippe 2e38eeaf9f Remove all comments with only the unrestricted annotation
The unrestricted annotation is Closure-specific and can be removed.
This patch removes all comments with only the unrestricted annotation
in them.

R=szuend@chromium.org

No-Presubmit: True
Bug: 1011811
Change-Id: Iba0723644f53f5307c3077d341271af86becc32a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2569758
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
2020-12-02 15:25:32 +00:00
Tim van der Lippe 159b890640 Fix issues for TypeScript 4.1 upgrade
These issues were uncovered by tsc 4.1.0-beta.

Since some of these promises don't care about the value they
should be resolving with, they should specify unused parameters.
However, ESLint is unhappy with that. Therefore, ignore any
parameter that starts with an underscore, per the docs of
https://eslint.org/docs/rules/no-unused-vars#argsignorepattern

R=jacktfranklin@chromium.org

Bug: 1011811
Change-Id: Ia18877a5529de2e607aaeae9547186b318023cd3
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2421688
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-09-21 11:11:40 +00:00
Tim van der Lippe 4aba148b6a Typecheck persistence/IsolatedFileSystem.js with TypeScript
R=szuend@chromium.org

Bug: 1011811
Change-Id: I401f86b80f2ecf35a558f66c208bbc8e5cb051d3
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2381415
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-08-28 11:14:11 +00:00
Jan Scheffler 98cd900373 Migrate front_end/persistence to devtools_entrypoint
R=aerotwist@chromium.org, jacktfranklin@chromium.org

Bug: 1101738
Change-Id: I837f9e570bb1e2e0ab13892b6bec4510ffa4f2a3
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2323628
Commit-Queue: Jan Scheffler <janscheffler@chromium.org>
Auto-Submit: Jan Scheffler <janscheffler@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-07-28 20:14:52 +00:00
Simon Zünd a292e76f9c Revert "Fix path escaping"
This reverts commit 10892e33a2.

Reason for revert: Breaks the web test http/tests/devtools/sources/debugger-breakpoints/nodejs-set-breakpoint.js
on the windows bot: https://ci.chromium.org/p/chromium/builders/try/win10_chromium_x64_rel_ng/620785?

Original change's description:
> Fix path escaping
> 
> Inconsistent URL escaping was breaking snippets, which by default
> have characters (space and #) which need to be escaped.
> 
> As a general rule, anything called 'url' or 'path' is now url-encoded,
> and anything called 'name' or 'platformPath' is not.
> 
> Bug: 1094436
> Change-Id: I7a26e9f2bfa676d0cc1b4731ea939ebc12222a25
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2266998
> Commit-Queue: Simon Zünd <szuend@chromium.org>
> Reviewed-by: Simon Zünd <szuend@chromium.org>
> Reviewed-by: Sigurd Schneider <sigurds@chromium.org>

TBR=sigurds@chromium.org,szuend@chromium.org,tvanderlippe@chromium.org,janscheffler@chromium.org,leese@chromium.org

Change-Id: I842706b3a5781f0ee767c1867d532f4c5d394543
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1094436
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2316073
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2020-07-23 19:22:31 +00:00
Eric Leese 10892e33a2 Fix path escaping
Inconsistent URL escaping was breaking snippets, which by default
have characters (space and #) which need to be escaped.

As a general rule, anything called 'url' or 'path' is now url-encoded,
and anything called 'name' or 'platformPath' is not.

Bug: 1094436
Change-Id: I7a26e9f2bfa676d0cc1b4731ea939ebc12222a25
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2266998
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
2020-07-23 11:23:08 +00:00
Patrick Brosset e65aaac861 Enable the no-return-assign ESLint rule
This rule disallows assigning a value in a return statement.
It also works in one-liner arrow functions.

For instance, a => a = 2 will trigger a warning.
This is to avoid cases where you actually meant to compare a to 2, not
assign the value 2 (maybe you wanted to return a boolean in a filter
callback).
These sorts of issues can easily pass review and cause weird problems
that are hard to track down later.

The rule is enabled in this CL, and all warnings are fixed with this CL.

More info about the rule: https://eslint.org/docs/rules/no-return-assign

Bug: 1093379
Change-Id: I38b98ea59ecaedc83a7f69073b17980808f9a3bf
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2242761
Reviewed-by: Patrick Brosset <patrick.brosset@microsoft.com>
Reviewed-by: Jose Leal <joselea@microsoft.com>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Patrick Brosset <patrick.brosset@microsoft.com>
2020-06-22 08:34:42 +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 d71c22d7ce Typecheck host/ with TypeScript
Hacks, hacks and hacks. These files were very inconsistent in terms of typing.
They now use the proper FileSystem API's (which ship with Closure, but not
with TypeScript).

R=szuend@chromium.org,jacktfranklin@chromium.org

Bug: 1011811
Change-Id: I46bd59d2f22372157afcdb18871442f51e20e778
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2108763
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2020-03-19 13:14:12 +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
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 5ebe0d728b [utilities] Inline Promise#catchException at all use-sites
This CL removes Promise#catchException and inlines its code at a
handful use-sites. This concludes the prototype monkey-patching
cleanup for Promise.

R=tvanderlippe@chromium.org

Bug: chromium:1050549
Change-Id: Ic3ec6e024ad34622d52c34d6da36447fe54929b0
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2095314
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-03-10 11:52:03 +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
Simon Zünd a0d40624e1 [utilities] Replace {valuesArray} with {values} and/or spread operator
For {Set}s we omit the call to Set#values, since spreading a set
{foo} "[...foo]" is equivalent to "[...foo.values()]".

Drive-by: Remove the now unused Map#valuesArray and Set#valuesArray.

Bug: chromium:1050549
Change-Id: Ic9b51f957d895265a79a7fa3471ecb6cb734a1f0
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2050770
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-02-12 16:45:22 +00:00
Tim van der Lippe f18c6a245e Migrate persistence/ to import cross-module
Bug: 1006759
Change-Id: I3ce19d116a250b975b809fdb59f4be1674ac2892
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2019545
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-01-24 15:09:25 +00:00
Paul Lewis 6bcdb18044 [Global] Update refs to Common.settings
Bug: 1006759
Change-Id: Ie1943b50ba8ba23fae4f52f958ae6f8c7b6a7d3f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2016744
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-01-23 11:29:11 +00:00
Paul Lewis 6196e75c80 Migrates persistence/ to ESM internally
Bug: 1006759
Change-Id: I3f6351fe6b9f97ca88b528369168bba2fe00f76b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1994978
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-01-13 15:48:34 +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 daf16278b1 Migrate persistence/ to ESM
- Rename Persistence.js to PersistenceImpl to avoid a name clash with
the namespace

Bug: 1006759
Change-Id: I330bd680c8a92984c4a75a0614efa78b4f1e1ea2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1845715
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#704200}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: c68c13c0d5c1a780340192be5d722dc7715b4bbc
2019-10-09 15:43:43 +00:00
Tim van der Lippe 50cfa9b19d Migrate host/ to ESM
Bug: 1006759
Change-Id: Ib72e0acbb20c4579e708cd79a67ffd0bc2073b70
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1829102
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#701509}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: b2641f7a9893b50ab7f74d8bc5b7ca7743b0a530
2019-10-01 10:40:58 +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
Alexey Kozyatinskiy 3a2eb28446 [DevTools] replace snippets mapping with snippet FileSystem
New snippets use file system instead of own mappings.

R=lushnikov@chromium.org

Bug: none
Change-Id: I7c8e9c1f88f3a555ba98ba613658dbde39c3f0a0
Reviewed-on: https://chromium-review.googlesource.com/1173751
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Reviewed-by: Andrey Lushnikov <lushnikov@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#584771}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 54feed0d242111c0fd08db4315bffccdcfdad749
2018-08-21 16:22:02 +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