Commit Graph
14 Commits
Author SHA1 Message Date
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
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
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
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 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 4b64b3f263 [Global] Remap refs to Common.moduleSetting
Bug: 1006759
Change-Id: Ia45ef0fd0b97588ca23a8d784c0564050b0bbf4c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2016748
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-01-23 12:00:20 +00:00
Tim van der Lippe fe5c3f7d1d Migrate formatter/ to ESM internally
Bug: 1006759
Change-Id: I1f5d50e3b42eae77dee3188c3c64215e57a68ea5
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1991635
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-01-09 16:56:41 +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
Tim van der Lippe 5368fbc9b8 Migrate formatter/ to ESM
Bug: 1006759
Change-Id: I2fbe172a8c8ba5380be45081f73b0d0459ad5e3f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1903478
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2019-11-09 23:54:33 +00:00
Sigurd Schneider 718eebb6a0 [devtools] Report end position for CSS scripts to DevTools front-end
This simplifies determining whether a location is inside a CSS header
in the front-end (the front-end doesn't have to request the source
to determine the end line:column from the start line:column and the
size).

Before/After: https://imgur.com/a/OFdQBNL

Bug: chromium:1005789, chromium:1005708, chromium:1004203
Change-Id: I4c660c2a5f901cfe24d022b2636926ecf99254ec
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1821721
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#704542}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 96b62150b53277fdadcf13264379f4de9b47a2da
2019-10-10 10:14:57 +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
Sigurd Schneider 5cc892d5f9 [devtools] Resolve less uiLocations to non-existent CSS/script locations
Both Bindings.cssWorkspaceBinding.uiLocationToRawLocations and well as
Bindings.debuggerWorkspaceBinding.uiLocationToRawLocations resolve
locations to non-existing CSS and Script locations. This patch fixes
Bindings.debuggerWorkspaceBinding.uiLocationToRawLocations to not do
this anymore, and hacks
Bindings.cssWorkspaceBinding.uiLocationToRawLocations to not do it
for formatted sources anymore. For the ultimate fix, we need to get
the end position for inline CSS from the back-end. This will allow
us to clean-up the hack as well.

The significance of this change is that it enables precise coverage
gutters for inline CSS and inline scripts.


Bug: chromium:1004203, chromium:1005708, chromium:1005789
Change-Id: Ieadb2aef7e610ecec35e28f5f1cc4516a28a0780
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1814299
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#698431}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 0a2176832ad71200173bab203b83a4128062683c
2019-09-20 10:21:41 +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