Commit Graph
109 Commits
Author SHA1 Message Date
Yang Guo b7a4426053 Fix npm run test
R=tvanderlippe@chromium.org

Change-Id: I7b970a8281831aa5f517a7bf64187a6a7757f5dc
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1899514
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
2019-11-06 14:51:45 +00:00
Tim van der Lippe b45d9a0a31 Remove ProductRegistry
Design doc: https://docs.google.com/document/d/1fRNhE_FXfCWwR8zOBkE5J5B6An53Lf0GbQHUB1QSnEI/edit?usp=sharing

Bug:664704,1011466
Change-Id: Iaec3f495a18b821b312694011129902a9c63f67f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1893080
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
2019-11-05 17:54:26 +00:00
Yang Guo 879d97b05d Move hosted mode scripts
Also set useful default for Chromium path for Linux.

Change-Id: Idcf5a229f254a8081338630bf9279678fb03e111
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1893089
Reviewed-by: Jan Scheffler <janscheffler@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
2019-11-05 13:36:56 +00:00
Tim van der Lippe 647e33b2a1 Reland "Implement lazy loading of modules"
This reverts commit cc75dee3ba.

Reason for revert: Race-condition fixed in devtools-compatibility.js

Original change's description:
> Revert "Implement lazy loading of modules"
> 
> This reverts commit 7c08ccfd54.
> 
> Reason for revert:
> 
> Breaks browser_tests. Steps to reproduce:
> - Build Chromium's browser_tests target
> - Run `xvfb-run -s "-screen 0 1024x768x24" out/Default/browser_tests --gtest_filter=DevToolsExtensionTest.TestDevToolsExtensionAPI`
> - Observe this failure: https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8897915672067501312/+/steps/browser_tests__with_patch_/0/logs/Deterministic_failure:_DevToolsExtensionTest.TestDevToolsExtensionAPI__status_FAILURE_/0
> 
> Original change's description:
> > Implement lazy loading of modules
> > 
> > Any module that is not autostart and has `modules` specified in its `module.json`
> > will now have its entrypoint dynamically imported. Update the release build script
> > to output the `modules` array as well so that the Runtime can load it.
> > 
> > Add additional entrypoints to `platform` and `dom_extension` to be consistent
> > with the naming patterns of all other modules
> > 
> > Bug:1006759
> > Change-Id: If6d10a13a62354079e3f8ee49bee4ecdcffa6758
> > Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1893085
> > Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
> > Reviewed-by: Paul Lewis <aerotwist@chromium.org>
> 
> TBR=yangguo@chromium.org,aerotwist@chromium.org,tvanderlippe@chromium.org
> 
> Change-Id: I22e8a341e841a99df0df9808a419cc070dd81bea
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: 1006759
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1893087
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Commit-Queue: Yang Guo <yangguo@chromium.org>

TBR=yangguo@chromium.org,aerotwist@chromium.org,tvanderlippe@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 1006759
Change-Id: Id69542e883fc4b852a79e83373773de256976f83
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1897686
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2019-11-04 19:25:35 +00:00
Mandy Chen 167e7ad444 Normalize line ending to LF in localizatioin scripts
TL;DR: When retrieving the file content with localization scripts,
normalize the line ending to LF.

Issue:
When a grdp file containing multi-line strings has CRLF line ending,
the parser doesn't work because the IDS hash is calculated based on the
content of the <message> tag, which expects LF line ending. The multi-
line string ends up having a different expected hash, and the parser
complains about it.

Repro:
Change line ending of front_end/coverage/coverage_strings.grdp to CRLF.

Fix:
Normalize line ending to LF when retrieving the file content.

Change-Id: If3a33978724a4bf9635738c67ada211e5e996e30
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1895994
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Mandy Chen <mandy.chen@microsoft.com>
2019-11-04 18:04:05 +00:00
Yang Guo 9117835a2a Move deps related scripts to scripts/deps
Change-Id: I283d589c92a813daa484f5c7fe83ee16e285f275
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1891416
Auto-Submit: Yang Guo <yangguo@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2019-11-04 11:53:25 +00:00
Yang Guo cc75dee3ba Revert "Implement lazy loading of modules"
This reverts commit 7c08ccfd54.

Reason for revert:

Breaks browser_tests. Steps to reproduce:
- Build Chromium's browser_tests target
- Run `xvfb-run -s "-screen 0 1024x768x24" out/Default/browser_tests --gtest_filter=DevToolsExtensionTest.TestDevToolsExtensionAPI`
- Observe this failure: https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8897915672067501312/+/steps/browser_tests__with_patch_/0/logs/Deterministic_failure:_DevToolsExtensionTest.TestDevToolsExtensionAPI__status_FAILURE_/0

Original change's description:
> Implement lazy loading of modules
> 
> Any module that is not autostart and has `modules` specified in its `module.json`
> will now have its entrypoint dynamically imported. Update the release build script
> to output the `modules` array as well so that the Runtime can load it.
> 
> Add additional entrypoints to `platform` and `dom_extension` to be consistent
> with the naming patterns of all other modules
> 
> Bug:1006759
> Change-Id: If6d10a13a62354079e3f8ee49bee4ecdcffa6758
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1893085
> Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
> Reviewed-by: Paul Lewis <aerotwist@chromium.org>

TBR=yangguo@chromium.org,aerotwist@chromium.org,tvanderlippe@chromium.org

Change-Id: I22e8a341e841a99df0df9808a419cc070dd81bea
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1006759
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1893087
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
2019-11-02 10:05:43 +00:00
Tim van der Lippe 7c08ccfd54 Implement lazy loading of modules
Any module that is not autostart and has `modules` specified in its `module.json`
will now have its entrypoint dynamically imported. Update the release build script
to output the `modules` array as well so that the Runtime can load it.

Add additional entrypoints to `platform` and `dom_extension` to be consistent
with the naming patterns of all other modules

Bug:1006759
Change-Id: If6d10a13a62354079e3f8ee49bee4ecdcffa6758
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1893085
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2019-11-01 16:38:43 +00:00
Mandy Chen 01845077f9 Fix regex in localization parser to recognize CRLF line ending
Update localization script to recognize CRLF line ending.

Change-Id: I80f2789023f281b9630a6943b95c09266789ef9c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1894551
Reviewed-by: Lorne Mitchell <lomitch@microsoft.com>
Commit-Queue: Mandy Chen <mandy.chen@microsoft.com>
2019-10-31 23:13:42 +00:00
Lorne Mitchell 0a1c649850 DevTools: Updated the generate_devtools_ui_strings.js/.py scripts to reference the new repo location.
Bug: 941561
Change-Id: I80d8f3a2a6fe3662985c257786e9a7cecfa5a53b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1888518
Reviewed-by: Mike Jackson <mjackson@microsoft.com>
Reviewed-by: Vidal Diazleal <vidorteg@microsoft.com>
Commit-Queue: Lorne Mitchell <lomitch@microsoft.com>
2019-10-30 15:15:34 +00:00
Ingvar Stepanyan 1a8762b0f1 Add native DWARF support
This adds native location resolver, written in Rust and compiled to
WebAssembly, that can parse DWARF information from other given
WebAssembly modules and resolve addresses <-> source location mappings
in both directions.

From V8 side, this depends on recently added Debugger.getWasmBytecode
command and on a special "wasm://dwarf" source map URL reported for Wasm
modules that contain DWARF information.

On the JavaScript side, this uses autogenerated JavaScript bindings by
wasm-bindgen to an internal context which contains all parsed data and
lazily creates SDK.SourceMapEntry when requested. These bindings are
further wrapped into a public class that implements SDK.SourceMap
interface.

---

Always auto-step over Wasm DWARF

Wasm doesn't have any other source when DWARF is used for source
mapping, so it will step into an empty source pane.

This is not very useful, so let's always auto-step to the next resolved
location.

There are talks about stabilising auto-stepping for JS source maps as
well, but for now limiting to just the new functionality should be
safer.

Change-Id: I6e981dcd33a03a5db2f2b1e39a93372c5ba09b97
Bug: 1016772
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1872581
Commit-Queue: Ingvar Stepanyan <rreverser@google.com>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
2019-10-30 00:51:22 +00:00
Yang Guo b89b085f36 Add __name__ == "__main__" guards to test scripts
R=tvanderlippe@chromium.org

Change-Id: I80d623cd1eb7c87386e8619e4dd7c568f79c5a67
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1884555
Auto-Submit: Yang Guo <yangguo@chromium.org>
Reviewed-by: Mike Jackson <mjackson@microsoft.com>
Commit-Queue: Yang Guo <yangguo@chromium.org>
2019-10-28 21:54:07 +00:00
Ingvar Stepanyan 70f122128c Fix build on Windows
Without this check, Python ends up spawning lots of Java processes and filling console with errors instead of building.

See https://stackoverflow.com/a/18205006.

Change-Id: Ia9956f649a59ec372dce675adcce31f072d8ee7f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1883723
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Ingvar Stepanyan <rreverser@google.com>
2019-10-28 16:36:56 +00:00
Tim van der Lippe 37fe72f23b Fix npm run test script
Change-Id: Id8917176d1d9f4c0f7245504beefba2d15988a0f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1883710
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
2019-10-28 14:31:46 +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
Paul Lewis 75090cfd93 Reland "Updates node_modules and update script"
This is a reland of 4df552c652

Original change's description:
> Updates node_modules and update script
> 
> Change-Id: I3fcf49bc416301a030d298cfc48c448bfeba4335
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1878808
> Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Commit-Queue: Paul Lewis <aerotwist@chromium.org>

Change-Id: I97d1442c21420488fadde3f17f67cd4e3b959be6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1880030
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
2019-10-25 13:19:06 +00:00
Lorne Mitchell db3885dd80 Revert "Updates node_modules and update script"
This reverts commit 4df552c652.

Reason for revert: Breaks esprima.

Original change's description:
> Updates node_modules and update script
> 
> Change-Id: I3fcf49bc416301a030d298cfc48c448bfeba4335
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1878808
> Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Commit-Queue: Paul Lewis <aerotwist@chromium.org>

TBR=yangguo@chromium.org,aerotwist@chromium.org,tvanderlippe@chromium.org

Change-Id: Iad2bcdf98a486476715d1e829cdce450c5f218af
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1880098
Reviewed-by: Lorne Mitchell <lomitch@microsoft.com>
Commit-Queue: Lorne Mitchell <lomitch@microsoft.com>
2019-10-24 21:53:24 +00:00
Paul Lewis 4df552c652 Updates node_modules and update script
Change-Id: I3fcf49bc416301a030d298cfc48c448bfeba4335
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1878808
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2019-10-24 14:48:04 +00:00
Yang Guo fa871b62c0 Introduce script to roll into Chromium
R=machenbach@chromium.org

Change-Id: I12095ad6c5232314537d63edf5fffecc2e9fcb06
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1876814
Commit-Queue: Yang Guo <yangguo@chromium.org>
Auto-Submit: Yang Guo <yangguo@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
2019-10-24 14:07:48 +00:00
Michael Achenbach 1473de827c Whitespace change to test bots
This also makes the whitespace file a data deps to force running
swarming tests on whitespace changes.

Change-Id: Ib71180609efca36ff78bc4339c6cccf1e90c673e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1872589
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
2019-10-22 12:20:54 +00:00
Mathias Bynens 032591d692 Fix formatting
Running `npm run format-py` on a fresh checkout results in some
changes. This patch commits those changes so that they do not
become part of unrelated CLs.

Change-Id: Ie8051c7907ac9624e9fe870e2137b9a9fe2769c3
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1871869
Auto-Submit: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
2019-10-21 13:02:51 +00:00
Michael Achenbach e18baf2ce8 Whitespace change to test bots
Change-Id: I2a7101deed226ab672d582253d19f5715e75e3af
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1871556
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
2019-10-21 11:10:23 +00:00
Yang Guo 015c235224 Add whitespaces.txt
TBR=machenbach@chromium.org

Change-Id: Icc4e94c16f099c2883418c63d46a79497b907fa8
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1869655
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
2019-10-21 08:29:11 +00:00
Yang Guo 4fd355cc40 Switch to new repository 2019-10-21 08:08:56 +02:00
Christy Chen d638d21ae7 DevTools: Update localization error message to warn about placeholder <ex>
The presubmit script did not warn about the missing example tag for placeholders.
This Cl added more details to the error message.
https://imgur.com/a/9I7hXfx

Bug: 941561
Change-Id: I2a950e4dd1fecc0a4dfea7467216c71c964c97b2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1845580
Commit-Queue: Christy Chen <chrche@microsoft.com>
Reviewed-by: Lorne Mitchell <lomitch@microsoft.com>
Reviewed-by: Mandy Chen <mandy.chen@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#707569}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 21c1a43916ce6b405246e60c5c21613f372fdb68
2019-10-18 22:45:52 +00:00
Yang Guo d584b90e85 Move unit tests to test/unittests
Change-Id: I4dd89cae3441f1da5ae4b2a393a3ff66a67f6451
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1859787
Auto-Submit: Yang Guo <yangguo@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#705524}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 94a941ed8494e3751c04db857a8f0513b98258a5
2019-10-14 12:17:30 +00:00
Tim van der Lippe a4d448c312 Migrate console_counters/ to ESM
- Also upgrade the refactor script to automatically add the
extensionpoint to the BUILD.gn to save myself some typing.

Bug: 1006759
Change-Id: I3f789f96122569141194ce26ac288f01af68f6e2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1852209
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#704600}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: e55e98bc0ca76229380e3bca5a78e15d953da0c5
2019-10-10 13:38:29 +00:00
Tim van der Lippe 226fc2224b Migrate extensions/ to ESM
Bug: 1006759
Change-Id: I55ff55840cbf00a108cb0f3630cf5b489bf3aac2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1849386
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#704574}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: a332bbea8c8a4c485dc20685b810c082c14a7b70
2019-10-10 12:17:12 +00:00
Mandy Chen 218413b440 DevTools: Only log error stack to avoid duplicate error messages
The localization parser currently logs the error stack and error message
when running without the --autofix flag. Since the stack includes the error
message, this CL takes out the call to log the error message to avoid
duplicate error messages.

Bug: 941561
Change-Id: If8c5f05148be6e2eb666eb17cefe649715006209
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1820088
Reviewed-by: Lorne Mitchell <lomitch@microsoft.com>
Commit-Queue: Mandy Chen <mandy.chen@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#703813}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: c9ef1c432008114038aade7d70fe815a036e7068
2019-10-08 17:47:21 +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
Yang Guo d81769871b DevTools: introduce devtools_paths.py to manage paths
The new devtools_paths.py detects whether the frontend code
is hosted in the Chromium repository, in an external repository during
standalone build, or in an external repository during integrated build.

R=aerotwist@chromium.org

Change-Id: I800ab63f985d203359e387f9c81df9270929b437
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1839791
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#703014}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: dd36b0f6b3fdbaa069facb239773596ae816febb
2019-10-04 20:30:35 +00:00
Tim van der Lippe 798ea142bc Migrate protocol/ to ESM
- InspectorBackendCommands is now loaded via ES Modules

Bug: 1006759
Change-Id: I2826518a55e1f4fd7704cfb04120885f9aa9b604
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1837772
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#702821}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 01369246df2350c6be2b0118d69313a7f56486bb
2019-10-04 12:01:23 +00:00
Tim van der Lippe bc38bd6964 Minify ES Modules files
After converting the `ui/` folder to ESM, there was a significant performance
regression in terms of file size of the `resources.pak`. It turns out that we
were not minifying ESM files, but we did do that before with Closure.

Update the `copy_devtools_modules` to also invoke rjsmin to minify the
JavaScript source code.

Before:
$ du -h -B K out/Default/resources.pak
12096K	out/Default/resources.pak

After:
$ du -h -B K out/Default/resources.pak
11752K	out/Default/resources.pak

Before the original CL transforming `ui/` landed:
$ du -h -B K out/Default/resources.pak
11860K	out/Default/resources.pak

This means that after converting `ui/` to ESM, we saved 90KB. We suspect
this is because we are no longer transpiling to ES5, but instead serve
source ES6.

Bug: 1010910
Change-Id: I7dd07ff788d014e9f9a8e25e168c58c010cd00af
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1837814
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#702500}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 8d2021d8394b9a248436fb6976070629cdffd961
2019-10-03 18:36:31 +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 99e59b8c29 Migrate Runtime.js to ESM
Introduce a new namespace "Root" to be able to disambiguate between
Runtime the namespace and Runtime the object.

roll CodeMirror
The above line is necessary to fix the presubmit, which complains
about CodeMirror changes. This is only updating a type reference.

Bug: 1006759
Change-Id: I04941d9f18649701060e3035f7eeb2ef3abb51e4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1829708
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#701257}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 17cc008cf6ad28c6e8c07c638a1b380ca30e7f79
2019-09-30 20:00:59 +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 7b190160cd Move InspectorFrontendHostAPI to externs
This was an interface that was already treated as an extern, but was not
explicitly in the externs.js file.

Bug: 1006759
Change-Id: I95301c059cc1213931498788cff553f955abb646
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1829098
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#700724}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: c6c1bf57acb1c9ed7304674e7d5df51122cb22b1
2019-09-27 15:10:44 +00:00
Paul Lewis 0cd45e3e49 Reland "[DevTools]: Moves common to ES modules"
This reverts commit 25a9b3bd7404d49e55772ffba046ed8df65ad14e.

Reason for revert: Memory snapshots work again

Original change's description:
> Revert "[DevTools]: Moves common to ES modules"
>
> This reverts commit e064553334d4b0c925f0b1f0e2e0234be66b71be.
>
> Reason for revert: Memory tool fails to take heap snapshots with this
> error: https://imgur.com/hzR9Eqw
>
> Original change's description:
> > [DevTools]: Moves common to ES modules
> >
> > This CL converts the contents of the common/ folder over to ES modules
> > from the current custom module system. It includes statements in each
> > file that will pollute the global namespace, allowing the non-ESM code
> > to continue working as before.
> >
> > Bug: 1006759
> > Change-Id: Ib591e49155000381f85999a5da6c467ad0160996
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1816563
> > Reviewed-by: Yang Guo <yangguo@chromium.org>
> > Commit-Queue: Paul Lewis <aerotwist@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#699728}
>
>
> Change-Id: Ic0d526780451e8bb4de538f11c85859a3badfb0f
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: 1006759
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1825463
> Commit-Queue: Yang Guo <yangguo@chromium.org>
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#699835}

Bug: 1006759
Change-Id: I48c7e84262bb295e5830cac8a79a274226df046c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1825420
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#699981}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 75a39ca7ac8dcfc6a830db07a5a389ca9ab27b1d
2019-09-25 22:19:27 +00:00
Brandon Goddard 52dd33a0b0 Revert "[DevTools]: Moves common to ES modules"
This reverts commit e064553334d4b0c925f0b1f0e2e0234be66b71be.

Reason for revert: Memory tool fails to take heap snapshots with this
error: https://imgur.com/hzR9Eqw

Original change's description:
> [DevTools]: Moves common to ES modules
>
> This CL converts the contents of the common/ folder over to ES modules
> from the current custom module system. It includes statements in each
> file that will pollute the global namespace, allowing the non-ESM code
> to continue working as before.
>
> Bug: 1006759
> Change-Id: Ib591e49155000381f85999a5da6c467ad0160996
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1816563
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Commit-Queue: Paul Lewis <aerotwist@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#699728}

TBR=yangguo@chromium.org,aerotwist@chromium.org,tvanderlippe@chromium.org

Change-Id: Ic0d526780451e8bb4de538f11c85859a3badfb0f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1006759
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1825463
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#699835}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 25a9b3bd7404d49e55772ffba046ed8df65ad14e
2019-09-25 16:58:21 +00:00
Tim van der Lippe 620071a920 Update the input language level of Closure compiler
This allows us to use more modern features like Object spread.

Change-Id: I3a8a119443cf43b27e3ac9390e188408976d82e2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1823847
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#699736}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: f7348e93165873639e57c78bd877e0640a7a6317
2019-09-25 13:33:32 +00:00
Paul Lewis 69d7770a96 [DevTools]: Moves common to ES modules
This CL converts the contents of the common/ folder over to ES modules
from the current custom module system. It includes statements in each
file that will pollute the global namespace, allowing the non-ESM code
to continue working as before.

Bug: 1006759
Change-Id: Ib591e49155000381f85999a5da6c467ad0160996
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1816563
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#699728}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: e064553334d4b0c925f0b1f0e2e0234be66b71be
2019-09-25 13:14:47 +00:00
Paul Irish e7b977eb54 DevTools: In l10n presubmit, apply ignore list to modified files
Change-Id: I31caa742e32727fcdd3c992fca0f815fefbf9740
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1818609
Auto-Submit: Paul Irish <paulirish@chromium.org>
Reviewed-by: Mandy Chen <mandy.chen@microsoft.com>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#699714}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: ea03feb17d2dac76b800aa9dd586a1812527bc2c
2019-09-25 12:23:38 +00:00
Mandy Chen e64996c39e DevTools: Add scripts to generate id mapping for localizable strings
The backend changes[1] for localizing devtools leverage the existing
webui functionalities, which consume a list of id mappings from the id
of a string used in the frontend (i.e. the English string) to the IDS_
key of the string in the corresponding grdp file. Example:

const LocalizedString kLocalizedStrings[] = {
  ...
  {"Editable", IDS_DEVTOOLS_2c09e798bf8c5a82d211331c82893a0f},
  ...
}

This patch adds scripts that generate the structure. The output will be
two files, devtools_ui_strings_map.h and .cc, under
<generated files root directory>/chrome/browser/ui/webui
(e.g. D:/chromium/src/out/Release/gen/chrome/browser/ui/webui).

The design is to create a build step that calls generate_devtools_ui_strings.py,
which then calls generate_devtools_ui_strings.js. Integration into the build
system will come as a another patch, because it depends on the first set of
changes[2].

Example arguments to generate_devtools_ui_strings.js to generate output
files (invoke under '--root_gen_dir', e.g. D:/chromium/src/out/release/gen
in the example below):

['D:/chromium/src/third_party/node/win/node.exe',
'D:/chromium/src/third_party/blink/renderer/devtools/scripts/build/generate_devtools_ui_strings.js',
'--root_gen_dir', 'D:/chromium/src/out/release/gen',
'--output_header', 'chrome/browser/ui/webui/devtools_ui_strings_map.h',
'--output_cc', 'chrome/browser/ui/webui/devtools_ui_strings_map.cc']

[1]: https://crrev.com/c/1672628
[2]: https://crrev.com/c/1628927

Bug: 941561
Change-Id: Ic03dae24cd074219790c6eec5df3183c24bf15a0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1671848
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Mandy Chen <mandy.chen@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#699370}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 3927e5494ba1866261dc577d8f93660fd9f04b5d
2019-09-24 16:12:59 +00:00
Tim van der Lippe fe98df5af5 Use the version of esprima in devtools-node-modules
We are going to update the version of Esprima to understand dynamic imports, but it turned out that this script was actually using a completely different version of Esprima. Update this path to resolve to our devtools-node-modules instead.

Bug: 1006759
Change-Id: I1f0b791a5afe86e94258b7b3a044f7e756b923f6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1821559
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>
Cr-Original-Commit-Position: refs/heads/master@{#699302}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: b596ed2ae4fb36ddb4f9682b8c2b93262bc084e7
2019-09-24 12:11:30 +00:00
Mandy Chen 08fdf04698 DevTools: Clean up localization parsing scripts
This CL:

* updates parseLocalizableResourceMaps to return maps of localizable
resources
* removes localizable resources from exports
* fixes non-async functions
* fixes existing parsing error

This CL is in preparation of https://crrev.com/c/1671848.

Bug: 941561
Change-Id: Id18faf3086fb8d9d3c75b110733784ba95cf56e9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1814539
Commit-Queue: Mandy Chen <mandy.chen@microsoft.com>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#699005}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: c108074d7327d594c73b0f6dc578da42632ba404
2019-09-23 19:57:20 +00:00
Mandy Chen 5128cc6c7a DevTools: Autofix out-of-date grdp/grd file paths in presubmit
This patch adds the functionality to autofix grdp/grd file paths that are
out of date.

* <part> file entries that reference non-existent grdp files in
devtools_ui_strings.grd are removed.

* Grdp files with the wrong names are renamed (format should be
<folder_name>_strings.grdp) along with the corresponding part file entries
in devtools_ui_strings.grd.

* If more than one grdp files are under a directory, an error is issued to
ask the user to consolidate these grdp files.

This patch will eliminate the need to manually fix grdp/grd inconsistensies
(e.g. https://crrev.com/c/1637591) after unexpected changes (e.g. audits2
renamed to audits: https://crrev.com/c/1614691).

Bug: 941561
Change-Id: Ie413fe070a2f5b4319a12ce07653ec1a79912215
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1703044
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Mandy Chen <mandy.chen@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#698917}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 3329fdbaecd905bf1a98a5ae24893d700571ba70
2019-09-23 16:46:00 +00:00
Tim van der Lippe 7ca9ec190d Copy individual symbols and comments for Closure
Closure was unhappy with the `Object.assign` solution. Instead, use
individual assignments and add the relevant comments, so that Closure
can understand what is going on.

Sample output:

```
/*Legacy exported object*/
self.UI = self.UI || {};

/*Legacy exported object*/
UI = UI || {};

//TODO(http://crbug.com/1006759): Add type information if necessary
UI.TextEditor = TextEditor;

//TODO(http://crbug.com/1006759): Add type information if necessary
UI.TextEditor.prototype = prototype;

/** @enum {symbol} */
UI.TextEditor.Events = Events;
```

Bug: 1006759
Change-Id: Ib0e571cc027f544b316a3e3ccf8c3d606273d887
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1819248
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Auto-Submit: Tim Van der Lippe <tvanderlippe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#698878}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: c1c9f965bfcf2dbcd8f868414874c085f4ff9515
2019-09-23 13:39:17 +00:00
Christy Chen fc8ed9f851 DevTools: Localize tags for command menu search to work properly
The tags in Module.json are not localized. This change localize them,
so when users type the word in command menu with languages other than
English, the results can show up correctly.

Two scripts edited (check_localized_strings.js, CommandMenu.js).
Grdp changes are generated automatically, with manually added descriptions.

Bug: 941561
Change-Id: I3dc1f8f8b72e21748f5fa84c1c60b9597aa0414a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1809673
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Mandy Chen <mandy.chen@microsoft.com>
Commit-Queue: Christy Chen <chrche@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#698223}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: b75a4b07ffd26a61fef0344123701241bb75002c
2019-09-19 22:18:44 +00:00
Tim van der Lippe 64bc95bd4b Automatically generate module file with exports
Since we are reading the file names anyways, we can also generate the
actual module name. Also delete the UI.js, since we will be generating
that now (albeit lowercase).

Change-Id: I16730392aa49927ac32da939a88399cc6ac49340
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1810999
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#698034}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: e80d12cb681bcd49518ec50763ede737bc86a136
2019-09-19 15:35:50 +00:00
Tim van der Lippe 790b9298b7 Reland "Reland "Convert ui/ARIAUtils.js to an ES module""
This reverts commit 901bcc219d9204748f9c256ceca0f2cd68061006.

Reason for revert: ESLint errors fixed

Original change's description:
> Revert "Reland "Convert ui/ARIAUtils.js to an ES module""
>
> This reverts commit ec810baced8e07ca3e9f2b801703be433807d2a2.
>
> Reason for revert: causing eslint failures on Linux Tests:
> /b/s/w/ir/third_party/blink/renderer/devtools/front_end/dom_extension/DOMExtension.js
>   817:10  error  'onInvokeElement' is defined but never used  no-unused-vars
> https://ci.chromium.org/p/chromium/builders/ci/Linux%20Tests/81950
>
> Original change's description:
> > Reland "Convert ui/ARIAUtils.js to an ES module"
> >
> > This is a reland of b3373919f86df10c190a8672ca828c7ea4b920e5
> >
> > Original change's description:
> > > Convert ui/ARIAUtils.js to an ES module
> > >
> > > ES modules allow files to explicitly import and export symbols [1].
> > > This patch migrates ARIAUtils.js to an ES module, while maintaining
> > > backwards compatibility with existing usages of `window.UI.ARIAUtils`.
> > >
> > > The build system is updated to copy these modules verbatim, as it no
> > > longer require pre-processing to be loaded. The `module.json` no longer
> > > includes this file as a script, to make sure it is not double-bundled
> > > into `shell.js`. Instead, it is added to the new field `modules`, which
> > > contains all modules. By doing so, it becomes clear which files are
> > > converted to modules already and which require the legacy references
> > > to the global scope.
> > >
> > > This module and future modules will be imported from `root.js`, which is
> > > added to all existing HTML application files.
> > >
> > > Design Doc: https://docs.google.com/document/d/1h9dOy3nNPNfZ2AtZXzB-DwJqG4Oo37WWvKLCuzCcPzo/edit?usp=sharing
> > >
> > > [1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import
> > >
> > > TBR=jochen@chromium.org
> > >
> > > Change-Id: Ie79c8f2fce3aff96fa28af0b575eae39bfe8e1a5
> > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1748949
> > > Reviewed-by: Jochen Eisinger <jochen@chromium.org>
> > > Reviewed-by: Yang Guo <yangguo@chromium.org>
> > > Commit-Queue: Tim van der Lippe <tvanderlippe@google.com>
> > > Cr-Commit-Position: refs/heads/master@{#697238}
> >
> > Change-Id: I7544cbf4364d0b1a3c2f137a4d17a1afdb1d4aed
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1810534
> > Reviewed-by: Yang Guo <yangguo@chromium.org>
> > Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#697626}
>
> TBR=yangguo@chromium.org,aerotwist@chromium.org,tvanderlippe@chromium.org
>
> Change-Id: I445fd35f135450cd9e8ed4c69bf913662f461ce6
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1811989
> Reviewed-by: Aaron Gable <agable@chromium.org>
> Commit-Queue: Aaron Gable <agable@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#697824}

Bug: 1004860
Change-Id: Idac8108b1b47488faa08473d2450a7ee0bdde96e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1813503
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#698029}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 4adc7b63ea9ea093206c62363c8fdf50fc64aed8
2019-09-19 15:14:16 +00:00