Commit Graph
29 Commits
Author SHA1 Message Date
Tim van der Lippe ba0e645b37 Fix remaining no-implicit-coercion errors in front_end/
R=jacktfranklin@chromium.org

Bug: 1082789
Change-Id: I100a53f7abd5d35565a3062769273e61c00cbafd
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2612902
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2021-01-07 14:30:46 +00:00
Tim van der Lippe 3c7eedcd60 Remove all definitions of usesObjectNotation
This was a temporary method, used during the migration to use
objects in dispatcher callbacks. Since all dispatchers now receive
the event as an object, we can remove these temporary methods.

R=aerotwist@chromium.org

Fixed: 1138492
Bug: 1011811
Change-Id: Ib7fbfae567ebc9b2be0a5d760458e5b0c7edc12e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2484723
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-10-20 10:59:51 +00:00
Sigurd Schneider 5a5b735963 Improve template types in Target/SDKModel
The Target.model method's type can be improved to convey the type of
the result (based on the constructor argument). This CL does just that.
This unlocks more checking down the line. The CL also alters the types
of the observeModel(s) methods, but in a weaker way, as closure is
apparently not able to instantiate the template correctly for method
invocations.

Bug: chromium:1011811
Change-Id: Ic466cfd946c30f3fcfb4ce24a8a0e1bc542e7d3f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2445776
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-10-05 12:21:48 +00:00
Tim van der Lippe 662c01bba2 Remove ProtocolProxyApiWorkaround
The upstream issue has been fixed in TypeScript 4 and therefore this workaround
is no longer necessary.

R=sigurds@chromium.org

Change-Id: I4a831566f3a7f7756f8938668c38e5fabe2ca14c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2367947
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
2020-08-21 14:10:19 +00:00
Sigurd Schneider f96d710ffa Remove unnecessary @unrestricted annotations from front_end/sdk
This CL removes 35 unnecessary @unrestricted annotations from
classes in front_end/ui.

Bug: chromium:1011811, chromium:1079233
Change-Id: I753a95f51e3ce8af6c7344ddc292c08fbb936184
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2209085
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
2020-05-20 15:17:43 +00:00
Sigurd Schneider ec3a7a8c95 Typescriptify ServiceWorkerCacheModel
Currently blocked on https://crbug.com/1081686

Bug: chromium:1011811, chromium:1079233
Change-Id: I03130db3b66dff45784a56d33d64f095236812cb
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2203450
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-05-20 08:33:07 +00:00
Tim van der Lippe ee6e3e9141 Add missing generic types
This is required for the TypeScript 3.9.2 upgrade

R=jacktfranklin@chromium.org

Bug: 1011811
Change-Id: I4336ee694b7b77344e13e3aded89d3db432cf6c9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2199126
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-05-13 14:34:31 +00:00
Tim van der Lippe 86e3a6a5ad Add missing return types for function parameters in sdk/
These are required for the upcoming TypeScript 3.9.2 upgrade.

R=jacktfranklin@chromium.org

Bug: 1011811
Change-Id: I6e9d568ea8a9c7482d355a7d8bc084a579a0202e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2199120
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-05-13 11:31:01 +00:00
Tim van der Lippe dc9d2515c5 Add @ts-nocheck annotations to sdk and typecheck sdk/Connections.js
To enable full parallelization of all files in sdk/, we can add the
@ts-nocheck annotation to all files. This suppresses existing
TypeScript errors in these files.

We can then one-by-one remove these annotations and fix the issues
reported in these files. This allows us to parallelize the work
and work on many files at the same time.

As a starter, I typechecked sdk/Connections.js to verify that
typechecking works while all other files are not checked yet.
I did do so by locally suppressing all TypeScript errors in
SDKModel.js and remove the `instance` method on `TargetManager`.
I then confirmed that rebuilding with TypeScript correctly
fails on the missing method, but does not require SDKModel.js
itself to be typechecked.

Bug: 1011811
Change-Id: I46de3839f7d837e951967dd932218bda00c6ad5b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2156352
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-04-22 13:17:59 +00:00
Simon Zünd 182134236e Rename namespace import for protocol_client to ProtocolClient
R=tvanderlippe@chromium.org

Bug: chromium:1011811
Change-Id: Idf3e9eb8f6d52db78f563de53b7576ec6c9b9cdc
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2107557
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-03-19 12:08:52 +00:00
Simon Zünd 3b0c540211 Rename front_end/protocol to front_end/protocol_client
This CL is part of the work to switch over to the TypeScript compiler
for type checking.

R=tvanderlippe@chromium.org

Bug: chromium:1011811
Change-Id: Ic709a193b252df7e9027c00cf20d8afe525a215a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2107539
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-03-18 18:06:20 +00:00
Paul Lewis a83ea61dac [global] Remaps self.Common.console
This CL changes references to self.Common.console (the global instance
of Common.Console) over to Common.Console.Console.instance(). To keep
both TypeScript and Closure happy we must make a method on the Console
class itself, since it only allows private constructors to be accessed
by static methods on the class.

Bug: 1058320
Change-Id: Icd4ac8aea76383588a5664a96643179d91812698
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2087757
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-03-04 13:20:05 +00:00
Tim van der Lippe c02a97ca2c Fix imports for Common.Event typedef
All references now use the fully qualified
"Common.EventTarget.EventTargetEvent". It renames it to
"EventTargetEvent" to prevent a name-clash with the native "Event" type.

Bug: 1006759
Change-Id: I13fcdfd613041da146d741a0d1f785bfc905a7a8
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2056481
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-02-14 15:21:06 +00:00
Tim van der Lippe 5ed0fb968c Fix internal bindings in sdk/
These were some left-over fixes that regressed while doing phase 3 of
ESM. It includes fixing the typedefs in sdk-legacy to be in the proper
file and exported.

Bug: 1006759
Change-Id: I939d4287a78888fba65d4baed04ee90f14c88e23
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2055065
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-02-14 15:21:06 +00:00
Tim van der Lippe d41d863344 Migrate sdk/ to import cross-module
Bug: 1006759
Change-Id: I1f4d365ca078007f9d5e5b005e748bac3993e8da
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2016757
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-01-23 16:10:20 +00:00
Paul Lewis 04ccecc2d7 [Global] Updates references to Common.console
Bug: 1006759
Change-Id: I5c854000a3de456a7cca34ca270c07dc0d53e0e7
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2014924
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-01-22 17:59:05 +00:00
Tim van der Lippe 9293af7230 Migrate sdk/ to ESM internally
Bug: 1006759
Change-Id: I2bb0c8eaa4fdc89edd8da2b12d9fd0e08d427174
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2003327
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-01-17 15:17:17 +00:00
Peter Marshall 3e4e569cd2 Remove asParsedURL on the String prototype
Use a static function on the ParsedURL class instead.

A lot of our tooling is happier linking through to the class method
rather than the prototype thing, and setting things on prototypes is
generally discouraged in JS for a bunch of reasons.

Change-Id: I95cf70ed58e7cca6d4c2bf7633b69199f513d068
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1958524
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
2019-12-10 09:00:24 +00:00
Jan Scheffler f46e203424 [application] Remove pagination from cache storage
This patch removes the pagination from the cache storage
view to make it more intuitive.

Fixed: chromium:988038
Change-Id: Ie7ae3b1c21aefea4683c868c9ac543dc5f285a54
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1875711
Commit-Queue: Jan Scheffler <janscheffler@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
2019-11-05 15:17:26 +00:00
Tim van der Lippe 20b29c2646 Enforce newlines at end of files
Trying to upload a CL with missing newlines at the end of files fails with the following warning:

These files should end in one (and only one) newline character:

Update the ESLint config to let the linter fix these errors.

Change-Id: Ia858b5864a1dc43144e0c6d81dedbf46376c2b8d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1897679
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>
2019-11-04 15:02:44 +00:00
Tim van der Lippe 9b7d21d126 Migrate sdk/ to ESM
Bug: 1006759
Change-Id: I3f5917ab3f5b3fb823ca460c395301ba19eed2df
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1841792
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#703381}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 5a7c8d13f806d781e8edb96a9b1f152d4fe1258a
2019-10-07 18:48: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
Joey Arhar a6abfa2519 [DevTools] Do not debug worker shadow pages
This change breaks pausing on start when inspecting a shared worker that
gets reloaded. More detail here: crbug.com/987024

Bug: 882467
Change-Id: I074b547996fd7f11d835fcebfdae32a4f7063a9f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1636110
Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org>
Commit-Queue: Kenichi Ishibashi <bashi@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Reviewed-by: Kenichi Ishibashi <bashi@chromium.org>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#685152}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 5dc1be4c957563e073c462b39a934f23d02461d0
2019-08-08 12:23:00 +00:00
Sergey Poromov 47ac039a86 Revert "[DevTools] Await clearing methods in ClearStorageView"
This reverts commit fd3d8cadb7971e2934bd98130335d789398ac139.

Reason for revert: http/tests/devtools/indexeddb/live-update-indexeddb-content.js is flaky.

Findit suspects this CL to be the reason for the recent test flakiness. See the bug for more information.

Bug: 979503

Original change's description:
> [DevTools] Await clearing methods in ClearStorageView
> 
> Part 1 of adding garbage collection after clearing is done.
> 
> Change-Id: I7022c1d6d0d3c8cfabce7f57ba5f689c135b6395
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1669175
> Reviewed-by: Erik Luo <luoe@chromium.org>
> Commit-Queue: Harley Li <hhli@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#673083}

TBR=luoe@chromium.org,hhli@chromium.org

Change-Id: I5849695b3e5d2c3646303c2f49a801ffbc3ee15f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1679704
Reviewed-by: Sergey Poromov <poromov@chromium.org>
Commit-Queue: Sergey Poromov <poromov@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#673265}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 5a63d041f4c585eaa540963686cc894a342e5de9
2019-06-28 09:28:22 +00:00
Harley Li 29943fa5b5 [DevTools] Await clearing methods in ClearStorageView
Part 1 of adding garbage collection after clearing is done.

Change-Id: I7022c1d6d0d3c8cfabce7f57ba5f689c135b6395
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1669175
Reviewed-by: Erik Luo <luoe@chromium.org>
Commit-Queue: Harley Li <hhli@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#673083}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: fd3d8cadb7971e2934bd98130335d789398ac139
2019-06-27 22:13:31 +00:00
Harley Li 2ba8ce75f8 [DevTools] Add entry counter to Application>Cache Storage
Without an entry counter, users might get confused how many entries
are in a cache storage, because the UI indication is not obvious enough.
Besides, adding an entry counter is consistent with IndexedDB tables.

When the path filter is not an empty string, the count reflects how
many responses were matched in total.

Bug: 930865
Change-Id: I058562a251163459eeb2adc24def4888f9a9e863
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1537254
Commit-Queue: Haihong Li (Harley) <hhli@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#644523}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 45237b838f0aaf393967a9a8b46d83bbee20851b
2019-03-26 21:17:21 +00:00
Harley Li 915e7e4ded [DevTools] Add request headers to cached response matching
In Applocation>Cache Storage, to preview a cached response, DevTools
needs to call requestCachedResponse() to the backend to fetch it.
Originally, DevTools is unable to fetch cached responses for requests
that have headers, and this is because in DevTools's beckend, the field
'headers' of mojom::blink::FetchAPIRequest remains unfilled. This
patch fixes the issue by filling this field.


Bug: 890359
Change-Id: I599cc1393d5c02baa7d7f90fc22fd379b1745090
Reviewed-on: https://chromium-review.googlesource.com/c/1455272
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Haihong Li (Harley) <hhli@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#630005}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 8a7dcd563bc62a5f48731b2c83a0413e59994990
2019-02-07 17:53:55 +00:00
Harley Li 574c7204c8 [DevTools] URL path filter in Application > cache storage
With this patch users are able to search for cache entries which contain a given
URL path in Application panel's cache storage table. Only entries that have the
matching URL paths will be displayed in the table, which supports pagination if
there are too many entries returned.

Bug: 884194
Change-Id: If285cc43859e82f5e59b80b1b761e9836aa5f510
Reviewed-on: https://chromium-review.googlesource.com/c/1345421
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Haihong Li (Harley) <hhli@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#613204}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 3c68e3a7bc37f6eeb338e7768735087ae469a329
2018-12-03 19:55:54 +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