Commit Graph
73 Commits
Author SHA1 Message Date
Tim van der Lippe e6ddf27aac Remove formatter/module.json
R=andoli@chromium.org

Bug: 1127902
Change-Id: Ib45084e1f0d23c02b22ae74afb6c7c5f73546513
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2686664
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Andres Olivares <andoli@chromium.org>
2021-02-12 14:14:59 +00:00
Tim van der Lippe 49f2cf1f4e Remove common/module.json
R=andoli@chromium.org

Bug: 1127902
Change-Id: Ie7556606b481d34e32fc46f684fa21fc04e1bd2d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2676143
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Andres Olivares <andoli@chromium.org>
2021-02-05 10:44:28 +00:00
Tim van der Lippe 0c9a847c17 Remove modules from migrated folders
These extensions have been migrated and therefore we can only
import them for the layout tests.

R=andoli@chromium.org

Bug: 1131500
Change-Id: Idd738a82b0405c14c11bc8845feb37211f63da69
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2647586
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Andres Olivares <andoli@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2021-01-25 16:27:15 +00:00
Tim van der Lippe cbdf5f2baa Migrate upperBound to array-utilities
R=szuend@chromium.org

Bug: 1050549
Change-Id: Icee0883ab986fe08d9766272549f5ed66aee8574
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2644901
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>
2021-01-25 12:21:23 +00:00
Tim van der Lippe d7cfd14814 Fix no-implicit-coercion errors in front_end/
R=jacktfranklin@chromium.org

No-Presubmit: True
Bug: 1082789
Change-Id: Ic77884bf7e9b5dc74053915b3b10699368841b66
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2595268
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2021-01-07 12:40:16 +00:00
Tim van der Lippe 6be8c13512 Add assertNever to platform for exhaustive switch statements
To make sure that a particular switch statement implements all
branches of, for example, a union or enum, we can implement the
`assertNever` function. This function will ensure in the type
system that the relevant branches are covered and will result
in compilation errors if a branch is missing.

This `assertNever` call is used together with a refactoring of
FormatterActions (which is a inlineable const enum) to ensure
that the tasks posted to the FormatterWorker stay in sync between
the formatter_worker and the FormatterWorkerPool. Since we can
not import the `formatter_worker` bundle in a non-worker context,
we instead extract it into a separate entrypoint, imported by both.

R=jacktfranklin@chromium.org

Bug: 1158395
Change-Id: Id643486936e7fad300d0f40774ee851adcc76ef5
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2589953
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-12-14 15:59:06 +00:00
Tim van der Lippe 441af8af42 Fix formatter_worker entrypoint inclusion for unit tests
For our unit tests, we couldn't import the entrypoint of the
formatter_worker, since that entrypoint assumed it was running
in a worker context. Since our Karma unit tests run in a browser
context, it would start throwing errors on the postMessage call.

Instead, we should separate out the concerns of the formatter_worker
implementation and integration of its worker context with the
FormatterPool. To that end, we separate the implementation bundle
from the worker integration into a separate file "formatter_worker-entrypoint.ts".

To ensure we retain full test coverage, the integration part is
tested through e2e-tests, while the implementation of the
formatter_worker will remain being tested by unit tests.

After this change, we will now also compute full code coverage for
the formatter_worker folder, which we couldn't do before.

All of this will be used to port CSS pretty-printing tests from
layout to Karma tests, which will require yet another implementation
detail of the formatter_worker, which will now be exported through
its bundle entrypoint.

R=aerotwist@chromium.org

Bug: 1024752
Change-Id: I5f10a3ebab10e1012cf2244df779cdc31da06ed7
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2575091
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-12-07 16:24:51 +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
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 7f0bf8aeb0 Use import.meta.url to reference formatter_worker
This allows us to remove the formatter_worker_entrypoint and its
files and instead reference `formatter_worker/` itself.

R=aerotwist@chromium.org

Bug: 1011811
Change-Id: I3d7330d947fff4c6e7974fe60338568a0e9d82d7
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2412330
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-11-26 17:10:14 +00:00
Benedikt Meurer 7c769fe9fa [formatter] Utilize available CPU cores.
Drive-by-fix: Use uppercase naming for constants as per the JavaScript
style guide.

Change-Id: I7b9adb7ec1067ab79319d79dd68668a53bf29f46
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2514437
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
2020-11-02 16:47:21 +00:00
Tim van der Lippe 01e7f12092 Typecheck formatter/FormatterWorkerPool.js with TypeScript
R=szuend@chromium.org

Bug: 1011811
Change-Id: Ie94ccfa1f0713cc64eea8088052be0adfe8fb450
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2502614
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2020-10-28 06:44:07 +00:00
Tim van der Lippe f19de97d8b Typecheck formatter/SourceFormatter.js with TypeScript
R=szuend@chromium.org

Bug: 1011811
Change-Id: I8d5cf38af8b7b3edac3a05dde5b4487b779178d0
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2502611
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-10-27 16:15:52 +00:00
Tim van der Lippe 317534b914 Typecheck formatter/ScriptFormatter.js with TypeScript
R=szuend@chromium.org

Bug: 1011811
Change-Id: I5b730121d9e5c591ab0516c344d34d7654fbc44f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2502609
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2020-10-27 15:03:57 +00:00
Tim van der Lippe 46e1bcace9 Remove pre_generates_legacy from module.json files
This was a temporary flag used during the build_release_applications
to GN migration.

R=aerotwist@chromium.org

Bug: 1131500
Change-Id: I8a772bcc4bee31dbd3270bf7ef62d8c97941024a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2484716
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-10-19 16:12:09 +00:00
Tim van der Lippe 8a408c1be4 Move legacy files from core modules to GN
R=aerotwist@chromium.org

Bug: 1131500
Change-Id: Ic61ee8b06fc5c6cfbc41682aebbdc232e91e556e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2476333
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-10-16 10:50:32 +00:00
Peter Marshall 1d8da1fddb Don't instantiate a SourceFormatter when modules are imported
This was causing problems when trying to write a unit test that
included a file which transitively included formatter.js, which was
instantiating a SourceFormatter, leading to a chain of unfortunate
events which relied on some other module already being loaded, which
it wasn't.

To avoid the dependency chain between the imports, expose a function
getSourceFormatter which lazily instantiates a shared instance.

Bug: 1136848
Change-Id: I7c255186e53e131127ba00b7f719f2f1b34301c2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2456592
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
2020-10-13 08:36:28 +00:00
Patrick Brosset 8e5cecab9e Guard against null event.data from worker in the script formatter
The FormatterWorkerPool._onWorkerMessage method can call its current
task's callback with null as its parameter.
This happen when the formatter work doesn't send event data back.

When this happens, it creates exceptions in the ScriptFormatter class.
So, this change simply guards against this.

Bug: 1132284
Change-Id: I9a995a2b81b5e211ae1690caad7bf56a4772c354
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2431404
Reviewed-by: Jose Leal <joselea@microsoft.com>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Patrick Brosset <patrick.brosset@microsoft.com>
2020-10-01 13:10:14 +00:00
Tim van der Lippe 73a80d4976 Move message handling of worker into formatter_worker.ts
Since formatter_worker.ts is the actual entrypoint for the worker,
we should perform the message handling and postMessage invocations
there. This allows us to remove accesses to the `self.postMessage`
global in the implementation of the parsers and formatters, allowing
proper unit testing. Note all `self.postMessage`s have been removed,
as that requires additional refactoring in a follow-up CL.

This also paves the way for removing `formatter_worker_entrypoint`,
which is currently a no-op file. That requires additional infrastructure
changes to `Common.Worker` to allow specify a subfolder of `front_end/`
to be passed as the entrypoint.

Note that this CL also removes the `parseSCSS` method, which appears to
be unused in both the Chromium codebase as well as externally. Testing
on stable shows that we are currently not formatting `.scss` files
anyways.

R=aerotwist@chromium.org

Bug: 1011811
Change-Id: I808c5ea83efa5ec9fed6bd1aec2418487f553848
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2410232
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-09-21 16:52:43 +00:00
Tim van der Lippe cac65d4fa0 Remove skip_rollup
This was a temporary flag as part of the devtools_entrypoint migration.
Since that migration has concluded, we can now remove all references
to it and clean up `build_release_applications.py`.

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

Bug: 1101738
Change-Id: I3ef9ec1a99bc9fc1758532124db22b3b4b1a5e2a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2391140
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-09-08 15:44:09 +00:00
Tim van der Lippe 19a45dfd55 Remove is_legacy_javascript_entrypoint
This removes the now-obsolete is_legacy_javascript_entrypoint build flag,
which was used as part of the devtools_entrypoint migration.

This uncovered that accessibility was still using devtools_pre_built
and a file was missing from the GRD variable.

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

Fixed: 1101738
Change-Id: Ie1556ccc1d1563c855417de18e896308de0cfe19
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2356305
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-08-28 12:32:29 +00:00
Jack Lynch 701020f385 Sources: Restore breakpoints on formatted code
This CL fixes a regression introduced in Chrome 61(!) where breakpoints
in pretty-printed code appear to persist after reloading the DevTools,
but don't actually function. The issue was that the source formatter
added its UISourceCode containing the formatted code to the project
before storing the metadata that allows its source mapping to work, so
the breakpoints for the pretty-printed code would be set on the
formatted script rather than mapped to a location in the actual script.

Video of bug: https://i.imgur.com/OTDlq5g.mp4

Same thing with the fix: https://i.imgur.com/AZ7nT17.mp4

Bug: 930334
Change-Id: I53830839ed45a78d11ad2cc27fc5cc1bf09ec4a4
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2368060
Reviewed-by: Jose Leal <joselea@microsoft.com>
Commit-Queue: Jack Lynch <jalyn@microsoft.com>
2020-08-27 23:30:38 +00:00
Paul Lewis 4b15caf847 Migrate text_utils to devtools_entrypoint
R=jacktfranklin@chromium.org

Bug: 1101738
Change-Id: Ib9172ba1fdf6a4e86b62fd031a72bca1075150e0
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2317318
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-07-27 13:15:17 +00:00
Jack Franklin 0bbebcba09 Migrate formatter to devtools_entrypoint
Bug: 1101738
Change-Id: I686acd7b8afb04de7df20e753b51a23cbdbb3588
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2312681
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-07-24 09:20:39 +00:00
Tim van der Lippe 37512b0d25 Remove empty script arrays from module.json files
If the module uses `modules` to load the JavaScript files, then
we can remove the `scripts` array altogether. Note that there
are still some modules left that use `scripts`, most notably
the `lighthouse_worker`, which is a remote module.

R=aerotwist@chromium.org

Bug: 1105476
Change-Id: Ie303e9835f5ce6d42ccae7b3a305d8f3df1af84c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2302597
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-07-17 10:05:33 +00:00
Tim van der Lippe 77e0c895b2 Remove RelaxedJSONParser
We should not be parsing our own JSON. Instead, we should be using
`JSON.parse`. However, `JSON.parse` is of course spec-compliant and
not "relaxed". Thus, it would fail on invalid JSON. But, we do show
invalid JSON as plain text. E.g., if you were to inspect an invalid
JSON response in the network tab and it is actually not valid JSON,
we don't show the fancy object-tree-view, but instead the raw content.

Given that having our own JSON parser is not ideal and we still
gracefully fall back to a usable JSON preview, we should remove the
RelaxedJSONParser.

After this change, we can handle valid JSON, valid JSONP and show a text
preview for invalid JSON(P).

R=aerotwist@chromium.org

Bug: 1098730
Change-Id: I3c0513518e36b29f35124b2810a119fd3828ff93
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2264560
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-06-29 16:55:23 +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
Yang Guo 3852a23f96 Seed more owners to front_end directories
Bug: chromium:1082687
Change-Id: I07ad07fba7513d674eb8b6e84d8296bf64d37230
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2207319
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Shane Clifford <shanejc@microsoft.com>
Reviewed-by: Leo Lee <leolee@microsoft.com>
2020-05-20 07:20:27 +00:00
Mathias Bynens 5e43b27e8b Reformat module.json files
This patch makes it so that all module.json files use the same
consistent indentation that matches .editorconfig and the rest
of the codebase. At the request of reviewers, one such file
(front_end/emulated_devices/module.json) has been excluded
from this patch. It will be reformatted in a separate CL.

Note that this patch does not “roll CodeMirror”, although a
pre-commit hook forces me to include that phrase in the commit
message because the module.json file in the relevant folder is
modified.

Bug: chromium:1070492
Change-Id: Ib31ed5232461e2f80bf05f31105fc919f6639b0a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2127007
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2020-04-14 05:35:23 +00:00
Paul Lewis 7cbdcaef5c [global] Remaps self.Workspace.workspace
Moves self.Workspace.workspace to an instance() method.

Bug: 1058320
Change-Id: I56f31b8bbba2db09ae25349516dba013ed807642
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2109760
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-03-19 11:12:32 +00:00
Paul Lewis 23883e36f5 [global] Remaps self.Bindings.debuggerWorkspaceBinding
Moves self.Bindings.debuggerWorkspaceBinding to an instance() method.

Bug: 1058320
Change-Id: Id9090073eb4a0b8715bba82ded470d15d718dcc6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2107529
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-03-18 12:06:08 +00:00
Paul Lewis 767a0a101e [global] Remaps self.Bindings.cssWorkspaceBinding
This CL changes references to self.Bindings.cssWorkspaceBinding (the
globalinstance of Bindings.CSSWorkspaceBinding.CSSWorkspaceBinding) over
to Bindings.CSSWorkspaceBinding.CSSWorkspaceBinding.instance(). To keep
both TypeScript and Closure happy we must make a method on the
CSSWorkspaceBinding class itself, since it only allows private
constructors to be accessed by static methods on the class.

Bug: 1058320
Change-Id: Ic42d2b76e5bcec38029827dce14e3bf06ceaf89a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2107520
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-03-17 18:34:18 +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
Tim van der Lippe 1cf8e42e6d Migrate typedefs in {event_listeners,extension,formatter,heap_snapshot_worker,help}-legacy.js
Bug: 1006759
Change-Id: Ic2e3b5d8ece70a14cf067c79a14e3695382fa75b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2100910
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-03-12 17:37:01 +00:00
Simon Zünd a5e36d3036 Consider all JavaScript to have side effects
Instead of trying to guess whether some JavaScript code
has side-effects or not in the DevTools front-end, we now
rely on V8's more robust capability to figure that out.

This CL is a rebased re-upload of Yangs CL: https://crrev.com/c/1956891

R=petermarshall@chromium.org

Bug: chromium:1031243
Change-Id: Ic3451ecd69251a5a9c1cb5066efeabe2d55c707b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2096712
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
2020-03-12 06:25:20 +00:00
Simon Zünd 44ca9f9dca [utilities] Remove Map#remove
This CL replaces calls to Map#remove with the native Map#delete.
The actual return value of Map#remove was only used at 3 call-sites
where the function was inlined.

Bug: chromium:1050549
Change-Id: I2b7fc8174a4f585f4caf9957e756156149039097
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2096438
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-03-10 12:18:23 +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 37a35fff86 Reland "Typecheck Object.js"
This reverts commit f996a1c537.

Reason for revert: Fixed incorrect refactoring in this CL.

Original change's description:
> Revert "Typecheck Object.js"
>
> This reverts commit 258665aca5.
>
> Reason for revert: Suspected of breaking the roll (https://crrev.com/c/2083712)
> Bot failure: https://ci.chromium.org/p/chromium/builders/try/linux-rel/322462?
>
> Original change's description:
> > Typecheck Object.js
> >
> > To typecheck the file Object.js with Typescript I had to fix the type errors from all other classes
> > that were using addEventListener or removeEventListener incinsistently.
> >
> >
> >
> > Bug: 1011811
> > Change-Id: I2fccbbd07ef3d9a581baa34233580bc6a9dbbfc3
> > Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2079794
> > Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
> > Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
> > Commit-Queue: Jose Leal <joselea@microsoft.com>
>
> TBR=szuend@chromium.org,joselea@microsoft.com,tvanderlippe@chromium.org,jacktfranklin@chromium.org
>
> Change-Id: I30e3d75eee463362107d6e6ad25df2b7d50f9d54
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: 1011811
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2081824
> Reviewed-by: Simon Zünd <szuend@chromium.org>
> Commit-Queue: Simon Zünd <szuend@chromium.org>

Bug: 1011811
Change-Id: I19ebbe0345a5c7380ed69d1ba2921adf0385228e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2084580
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-03-03 14:09:44 +00:00
Simon Zünd f996a1c537 Revert "Typecheck Object.js"
This reverts commit 258665aca5.

Reason for revert: Suspected of breaking the roll (https://crrev.com/c/2083712)
Bot failure: https://ci.chromium.org/p/chromium/builders/try/linux-rel/322462?

Original change's description:
> Typecheck Object.js
> 
> To typecheck the file Object.js with Typescript I had to fix the type errors from all other classes
> that were using addEventListener or removeEventListener incinsistently.
> 
> 
> 
> Bug: 1011811
> Change-Id: I2fccbbd07ef3d9a581baa34233580bc6a9dbbfc3
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2079794
> Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
> Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
> Commit-Queue: Jose Leal <joselea@microsoft.com>

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

Change-Id: I30e3d75eee463362107d6e6ad25df2b7d50f9d54
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1011811
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2081824
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2020-03-03 05:59:28 +00:00
Jose Leal Chapa 258665aca5 Typecheck Object.js
To typecheck the file Object.js with Typescript I had to fix the type errors from all other classes
that were using addEventListener or removeEventListener incinsistently.



Bug: 1011811
Change-Id: I2fccbbd07ef3d9a581baa34233580bc6a9dbbfc3
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2079794
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Jose Leal <joselea@microsoft.com>
2020-03-02 18:15:06 +00:00
Simon Zünd b867043d77 Prepare SourceFormatter.js for asynchronous live locations
To support asynchronous source mapping, live locations must support
asynchronous updates. This CL prepares SourceFormatter.js for
asynchronous live location updates by properly {await}ing calls to
{updateLocations} on the different binding models.

R=sigurds@chromium.org

Bug: chromium:1032016
Change-Id: I347c69ffdd8d9d4870e62bf3bda17cd8dacb250c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2071877
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
2020-03-02 07:51:53 +00:00
Jack Franklin 4289552031 Remove String.prototype.computeLineEndings
In favour of `StringUtilities.findLineEndingIndexes`.

Kept the old code around in the layout tests; I think the duplication is
fine here given these tests are largely deprecated in favour of e2e
tests.

Change-Id: I4f15097c6880a516d9dbc7bb4f5da68a938f63f9
Bug: 1050549
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2060002
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-02-28 12:03:08 +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 fbbf981a34 Migrate sources/ to import cross-module
Bug: 1006759
Change-Id: I9b91ba0c24a14ca4d30cf3dd4469d5e162bc96db
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2054548
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-02-13 17:11:00 +00:00
Simon Zünd f27be3d65c [utilities] Replace {keysArray} with {keys} plus spread operator
This CL is part of the cleanup effort to get rid of prototype
wrangling in utilities.js.

Note that {keysArray} on Set/Map can't be removed yet, as there are
a few use-sites in upstream chromium web tests that need to be cleaned
up first.

Bug: chromium:1050549
Change-Id: I3d5cdc9211763f53d0d43a110a67bba9485d0a11
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2046555
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2020-02-11 15:38:21 +00:00
Tim van der Lippe 6f088c0566 Migrate formatter/ to import cross-module
Bug: 1006759
Change-Id: I7b34af07380dc687f225cae05676061c099d6094
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2017515
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-01-24 10:45:28 +00:00
Paul Lewis 10e83a9276 [Global] Update refs to Workspace.workspace
Bug: 1006759
Change-Id: Ic3d797a12e9c00b3b428e68bfd5be4b99a0d606c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2016756
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-01-23 14:33:20 +00:00
Paul Lewis 2ddc6313de [Global] Updates refs for bindings globals
Bug: 1006759
Change-Id: Ib73c3ce4b014126da088851bfeccdff49d6ba0ea
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2016754
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-01-23 13:37:40 +00:00