27 Commits
Author SHA1 Message Date
Nikolay Vitkov d36860c0b4 [eslint] Enable useful rules
@typescript-eslint/no-inferrable-types Simplifies the code and makes
type be more specific.

@typescript-eslint/return-await In theory more performant, but also
provides better debugging experience.

@typescript-eslint/ban-ts-comment Disallow all but ts-expect-error, as
else the error may get fixed not remove and later mask unrelated issues

Bug: 397260638
Change-Id: I09f268eb9157336635c378fa76546a4196e448e9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6281149
Reviewed-by: Victor Porof <victorporof@chromium.org>
Commit-Queue: Nikolay Vitkov <nvitkov@chromium.org>
Auto-Submit: Nikolay Vitkov <nvitkov@chromium.org>
2025-02-19 10:49:41 -08:00
Philip Pfaffe 468ab362b6 Shorten filename embedded by code_generator_frontend.py
The code generator embeds the last n entries of its own filename into
the generated InspectorBackendCommands. It used to be n=4, which
happens to create a different filename depending on whether the
script is run from a chromium or a standalone devtools-frontend
checkout. So set n=3.

DISABLE_THIRD_PARTY_CHECK=Updating code genrator

Bug: none
Change-Id: I09fad6d43377c8558709cbe41dba106f9c813caf
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4852085
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Philip Pfaffe <pfaffe@chromium.org>
2023-09-11 13:29:02 +00:00
Hadrien Jaubert 4c4ae29024 [Protocol Monitor] Add support for enums not defined via $ref
In some cases, the enums parameters are not referenced with $ref and there is just an array of all accepted values inside browser_protocol.json
This CL adds a typeRef inside the registerCommand for those cases.
DISABLE_THIRD_PARTY_CHECK=needed to build

Bug: 1474336
Change-Id: I6239a90e225a54c3e884c59b3fbaea9f45eea92a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4793639
Reviewed-by: Simon Zünd <szuend@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Hadrien Jaubert <hadrienjaubert@google.com>
2023-08-22 09:29:32 +00:00
Hadrien Jaubert e3454dba71 [Protocol Monitor] Change type of description inside registerCommand to string
DISABLE_THIRD_PARTY_CHECK=needed to build

Bug: 1464499
Change-Id: Ib5ddda1635bb603fbcbc04a9c9d9ea6e53e364f2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4678758
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Hadrien Jaubert <hadrienjaubert@google.com>
Reviewed-by: Nancy Li <nancyly@chromium.org>
2023-07-13 12:29:41 +00:00
Hadrien Jaubert d32b2acf8a [Protocol Monitor] Change type of description inside registerCommand to string
DISABLE_THIRD_PARTY_CHECK=needed to build

Bug: 1464499
Change-Id: I1e376bafb5179e24d431e8a1118d24c642d89348
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4683137
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Hadrien Jaubert <hadrienjaubert@google.com>
Reviewed-by: Nancy Li <nancyly@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
2023-07-13 10:34:34 +00:00
Hadrien Jaubert a511470fd6 [Protocol Monitor] Change python script to access the description of commands and parameters
DISABLE_THIRD_PARTY_CHECK=needed to build

Bug: 1463211
Change-Id: I506bdd07805a0b481cd73ca0c31baf1dff7977e2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4675888
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Hadrien Jaubert <hadrienjaubert@google.com>
2023-07-11 13:17:30 +00:00
Hadrien Jaubert 04f758225d [Protocol Monitor] Add typeRef for strings in array parameters
We need access to the typeRef for array parameters. At the moment string type was not supported.
Moreover, the registerType only contains types relating to objects. This CL adds support as well for types directly relating to arrays.

DISABLE_THIRD_PARTY_CHECK=needed to build

Bug: 1462270
Change-Id: I0375228a9315e35819c93e7deeb149121765f52b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4665825
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Hadrien Jaubert <hadrienjaubert@google.com>
2023-07-06 08:09:06 +00:00
Hadrien Jaubert 17d2240ee2 Add registerType command for array parameters
The protocol Monitor needs to know the type of array parameters. To do this, the CL will add type reference to registerType inside the InspectorBackendCommands.js file. It is then possible to know what type of parameters array parameters accept.

DISABLE_THIRD_PARTY_CHECK=needed to build

Bug: 1462096
Change-Id: I623ef4fef1f49f7618f2a874490a515ce22ce1cd
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4660370
Commit-Queue: Hadrien Jaubert <hadrienjaubert@google.com>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2023-07-04 11:09:52 +00:00
Hadrien Jaubert 158c1fc712 [Protocol Monitor] Change python script to create registerType
This CL adds the ability to have access to a map enabling the user to have access to all the keys of object parameters. To do that, this CL modifies code_generator_frontend.py to generate a new command called RegisterType.

DISABLE_THIRD_PARTY_CHECK=make build work

Bug: 1458788
Change-Id: I28bf0baf3841cf3120d103e40925698d3c8114b2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4650362
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Hadrien Jaubert <hadrienjaubert@google.com>
2023-06-29 10:17:47 +00:00
Hadrien Jaubert cafa2786f7 [Protocol Monitor] Add support for array parameters
This CL adds the ability to edit array parameters in the Protocol Monitor. To do that, this CL modifies code_generator_frontend.py to  report the array as a parameter type. Runtime type checks in InspectorBackendCommands.js are modified to account for the new parameter type.

DISABLE_THIRD_PARTY_CHECK=needed to build correctly

Screenshot : https://bugs.chromium.org/p/chromium/issues/detail?id=1457512

Bug: 1457512
Change-Id: I368c0146975d95fa024d59f4fb3e7d4ab590722d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4640225
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Reviewed-by: Nancy Li <nancyly@chromium.org>
Commit-Queue: Hadrien Jaubert <hadrienjaubert@google.com>
2023-06-27 13:13:08 +00:00
Liviu Rau 3da5d4a22e Run build scripts with vpython3
Bug: 1292013
Change-Id: Idf2e5de0b6ca3a296e5efd7952911783d6005e30
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3484196
Reviewed-by: Tim Van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Liviu Rau <liviurau@chromium.org>
2022-02-25 10:12:14 +00:00
Sigurd Schneider b509ae7393 Avoid generating a double newline in code_generator_frontend.py
Bug: chromium:1106746
Change-Id: If9a4074466c1df88c2810ac188dac00390e5fcea
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3074605
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
2021-08-05 11:40:19 +00:00
Sigurd Schneider 297b80bd3c Distinguish qualified and unqualified names
This change distinguishes qualified and unqualified names in
the inspector backend to avoid programming mistakes.

DISABLE_THIRD_PARTY_CHECK=disable

Bug: chromium:1172300
Change-Id: I0e0bdd82e9a4f7ce4feff459159bc18d124a949a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3003258
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2021-07-05 13:08:18 +00:00
Tim van der Lippe 8e12f92229 Use Python version bundled with depot_tools for all scripts
depot_tools ships a "vpython" binary that is added to the $PATH
for all Chromium engineers. This binary is versioned by depot_tools
which we roll in ourselves as part of `gclient sync`.

By using `vpython` instead of `python`, we are no longer depended
on the Python version installed locally and instead use the version
we pull in from DEPS.

R=liviurau@chromium.org

Change-Id: If49a54c24b6cf129ff843cd9ca1140a723a78afb
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2571462
Reviewed-by: Liviu Rau <liviurau@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-12-04 14:08:59 +00:00
Sigurd Schneider 66497ccc5f Generate inlined enums for protocol events in Protocol.<domain>
Previously, only inlined enums for commands were generated. This allows
several twin definitions to be removed from the front-end code, easing
the maintainance burdon of having to keep them in sync. See e.g.
https://crrev.com/c/2562339

Change-Id: I48ad1082ae8ecd3a657f61530e1795c61792ac56
Bug: chromium:1153099
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2562338
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-11-26 14:39:54 +00:00
Tim van der Lippe 0a2971a084 Remove _hasErrorData from AgentPrototype
This field is unused and always false. This means we can remove more code
from InspectorBackend.js and InspectorBackendCommands.js.

R=sigurds@chromium.org

Change-Id: I52155f202765aa66a7dd3e79adf99eb1be7814cb
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2230524
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Changhao Han <changhaohan@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
2020-06-05 12:37:19 +00:00
Jan Scheffler e6ca9bd614 Add support for enums defined in parameters
Change-Id: Ibb02f77a67b020d1d9f178f4af5bcc4ad993e916
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2204103
Commit-Queue: Jan Scheffler <janscheffler@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-05-15 13:56:56 +00:00
Tim van der Lippe 5d2d79b814 Fix presubmit check to always run when generated files change
We are changing the build output in the generated file, but were not
properly checking that these were changed, as the presubmit check
was ignoring files in the `front_end/generated` folder.

Also fix the issue where the InspectorBackendCommands.js would be
changed to not emit the typedef.

R=szuend@chromium.org

Bug: 1011811
Change-Id: I2e09bce9cae69f4191d93de177b5ab5bb7da46c0
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2115630
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
2020-03-23 12:34:41 +00:00
Tim van der Lippe b3b90761b1 Generate InspectorBackendCommands.js on presubmit
This checks in the InspectorBackendCommands in the source tree file
and ensures that it is kept in sync whenever the third_party
location has been updated.

In the process, I discovered multiple misconfigurations in the formatting
presubmit check. First of all, it was never running, because the
.eslintignore had an empty line. Second of all, it was running twice,
which is unnecessary since we now check for changed files at the end
of the presubmit. Lastly, it was only formatting JS files, while it
should check all files.

I have also updated the _CheckGeneratedFiles check to only run if it
is actually necessary. If there are no changes made to any affected of
the files, it will skip the step. This should thus reduce the presubmit
time and we will only pay the cost if we actually update any of the
files.

Lastly, it will now properly format and lint the generated files. This
makes reading the code a lot easier and makes it easier to digest the
diff when a protocol update goes through. I have verified that, in a
full build, the files are still minified. Thus, this has no impact on
the loading performance.

DISABLE_THIRD_PARTY_CHECK=Updating protocol generation

Fixed: 1056614
Change-Id: If49b0e749978ea1a7838992ec13507ee761ad76c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2087765
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-03-04 15:52:35 +00:00
Brandon Goddard 53faba1c7d Reland "Add script that checks license headers of JavaScript files"
This reverts commit 27f15d113a.

Reason for revert: script is fixed on Windows

Original change's description:
> Revert "Add script that checks license headers of JavaScript files"
>
> This reverts commit 6122ebd2f9.
>
> Reason for revert: Presubmit fails on windows due to relative
> path comparison with excluded files
>
> Original change's description:
> > Add script that checks license headers of JavaScript files
> >
> > The script checks if the license header is the BSD-3 license header that
> > DevTools is licensed under. It excludes files that have license headers
> > that reference non-Google/non-Chromium authors or are third_party
> > bundles that are checked into a non-third_party folder.
> >
> > Change-Id: I35f78036b48d3d7b7dcb9db1e070691282e27a02
> > Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2016747
> > Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
> > Reviewed-by: Liviu Rau <liviurau@chromium.org>
> > Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
>
> TBR=bmeurer@chromium.org,aerotwist@chromium.org,tvanderlippe@chromium.org,liviurau@chromium.org
>
> Change-Id: Idc27e9b78d5ac314176c71f8f4a7a2257da08be9
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2019019
> Reviewed-by: Lorne Mitchell <lomitch@microsoft.com>
> Reviewed-by: Brandon Goddard <brgoddar@microsoft.com>
> Commit-Queue: Brandon Goddard <brgoddar@microsoft.com>

TBR=bmeurer@chromium.org,aerotwist@chromium.org,lomitch@microsoft.com,brgoddar@microsoft.com,tvanderlippe@chromium.org,liviurau@chromium.org

Change-Id: I191665c8e3fdbee7f3c5c312b5ba00513502e080
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2019021
Reviewed-by: Fabio Rocha <fabio.rocha@microsoft.com>
Commit-Queue: Brandon Goddard <brgoddar@microsoft.com>
2020-01-24 18:16:35 +00:00
Brandon Goddard 27f15d113a Revert "Add script that checks license headers of JavaScript files"
This reverts commit 6122ebd2f9.

Reason for revert: Presubmit fails on windows due to relative
path comparison with excluded files

Original change's description:
> Add script that checks license headers of JavaScript files
> 
> The script checks if the license header is the BSD-3 license header that
> DevTools is licensed under. It excludes files that have license headers
> that reference non-Google/non-Chromium authors or are third_party
> bundles that are checked into a non-third_party folder.
> 
> Change-Id: I35f78036b48d3d7b7dcb9db1e070691282e27a02
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2016747
> Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
> Reviewed-by: Liviu Rau <liviurau@chromium.org>
> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>

TBR=bmeurer@chromium.org,aerotwist@chromium.org,tvanderlippe@chromium.org,liviurau@chromium.org

Change-Id: Idc27e9b78d5ac314176c71f8f4a7a2257da08be9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2019019
Reviewed-by: Lorne Mitchell <lomitch@microsoft.com>
Reviewed-by: Brandon Goddard <brgoddar@microsoft.com>
Commit-Queue: Brandon Goddard <brgoddar@microsoft.com>
2020-01-24 16:50:05 +00:00
Tim van der Lippe 6122ebd2f9 Add script that checks license headers of JavaScript files
The script checks if the license header is the BSD-3 license header that
DevTools is licensed under. It excludes files that have license headers
that reference non-Google/non-Chromium authors or are third_party
bundles that are checked into a non-third_party folder.

Change-Id: I35f78036b48d3d7b7dcb9db1e070691282e27a02
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2016747
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Liviu Rau <liviurau@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
2020-01-24 11:51:49 +00:00
Tim van der Lippe 4d1ddf7f73 Migrates protocol/ to ESM internally
Bug: 1006759
Change-Id: I99743fcf3d33bc1e5a3b729c2c544826e1d8e923
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2013156
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-01-23 13:19:20 +00:00
Yang Guo 75beda900f Move test scripts to scripts/test
R=aerotwist@chromium.org, liviurau@chromium.org, machenbach@chromium.org

Bug: 1018122
Change-Id: I7cc3a1a9ab01c649b3c7fe8ba5d5254adc631634
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1880033
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Liviu Rau <liviurau@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
2019-10-28 07:57:59 +00:00
Yang Guo 4fd355cc40 Switch to new repository 2019-10-21 08:08:56 +02:00
Johannes Henkel ff4efae492 [DevTools] Interpret 'binary' as 'string' on frontend
This means it's up to the client of the protocol layer to decode
the base64, just like before the introduction of 'binary'.

My overall WIP change is in here, and happy to explain more:
https://chromium-review.googlesource.com/c/chromium/src/+/1244719

Bug: chromium:891377
Change-Id: I60762ff2a815afe2bb0b69480340f1904a1d9909
Reviewed-on: https://chromium-review.googlesource.com/c/1281877
Commit-Queue: Johannes Henkel <johannes@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#600039}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 719629d34caae2c98b184f4a3c96f6cf7edf2e05
2018-10-16 17:55:58 +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