Commit Graph
1015 Commits
Author SHA1 Message Date
Yang Guo 0802bf5001 Fix running unit tests on Win and Mac
Change-Id: Ie87490a21cc0af5188d31a1a89c567895f925372
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1908568
Reviewed-by: Jan Scheffler <janscheffler@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Auto-Submit: Yang Guo <yangguo@chromium.org>
2019-11-11 14:46:05 +00:00
Tim van der Lippe c40495063d Migrate cm/ to ESM
roll CodeMirror

Bug: 1006759
Change-Id: I1eee7cbb8f50ca0637828a82531663a371a20044
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1903474
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2019-11-10 01:08:53 +00:00
Tim van der Lippe 601965061c Migrate diff/ to ESM
Bug: 1006759
Change-Id: I63577385ecd6c91b9843dfafc669317adb76d88a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1903475
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2019-11-09 23:31:53 +00:00
Paul Lewis f16142c532 Migrate accessibility/ to esm
Bug: 1006759
Change-Id: I9544f28e103acf0869cd6b3d98681b5788498ae0
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1893084
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2019-11-07 18:06:05 +00:00
Paul Lewis 3940ef25f1 Move data_grid over to ESM
Bug: 1006759
Change-Id: I02a7fc01bff612cf057c918df7449734bba241b7
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1893076
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2019-11-07 14:42:25 +00:00
Tim van der Lippe fd90361fad Rollup workers and migrate dependent modules
Since workers do not support modules [1], it is not possible to
currently import any ESM DevTools module. To be able to migrate
text_utils/ to ESM, we would need to duplicate a large portion of
text_utils/, which would be unmaintainable.

We already had the same situation when we migrated platform/ to ESM and
decided to copy the relevant functions, but this time around that is no
longer an option.

Thus, the 2 workers (heap_snapshot_worker and formatter_worker) are now
being bundled on build time. This means that in a release build, the
respective entrypoints are bundled and inserted in the output.

To bundle, we use `rollup`, which is a bundler only concerned with
rolling up ES modules. All other functionality of rollup (such as
tree-shaking) is unused. We can revisit later if we need a bundler for
the rest of devtools, but since we are in active migration to ESM that
is infeasible at this point in time.

As part of this CL, the following folders are migrated to ESM:
- cm_headless/
- formatter_worker/
- heap_snapshot_model/
- heap_snapshot_worker/
- text_utils/

Since text_utils is also an autostart module for the shell, this is the
only module that is imported from root.js.

Some of these modules also include files that are annotated with
skip_compilation and thus run with dummy files during Closure
compilation.

Note that, because of the usages of import-statements in the workers
and the blocking bug [1], the workers are generated even when Chromium
is built with `debug_devtools=true`.

Since heap_snapshot_model/ also used in the profiler, we have to eagerly
load this module in root.js. Once all other dependencies of the profiler
have been migrated to ESM, we can remove this import-statement.

[1]: crbug.com/680046

Bug:1013129,1006759
Change-Id: I4c03c7b8a1f351ae9693cbcd922412083dd34bba
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1883707
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2019-11-07 11:55:25 +00:00
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