WebUI cleanup: Rename use_vulcanize GN flag to optimize_webui
Vulcanize tool has been replaced with polymer-bundler. But also several other optimization tools are invoked when this flag is used (polymer-css-build, crisper, uglify), therefore the more generic "optimize_webui" name seems more appropriate. This is addressing an already existing TODO in the code. Bug: 731881 Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation Change-Id: I0d25b1306141ef01f4d40a0cb9c0b79cccb6837f Reviewed-on: https://chromium-review.googlesource.com/663215 Commit-Queue: Demetrios Papadopoulos <dpapad@chromium.org> Reviewed-by: Dan Beam (no longer on Chrome) <dbeam@chromium.org> Cr-Commit-Position: refs/heads/master@{#502639}
This commit is contained in:
chrome
browser
common
docs
@ -4304,7 +4304,7 @@ grit("resources") {
|
||||
"//url/mojo:url_mojom_origin_js",
|
||||
]
|
||||
|
||||
if (use_vulcanize) {
|
||||
if (optimize_webui) {
|
||||
deps += [
|
||||
"//chrome/browser/resources/md_bookmarks:build",
|
||||
"//chrome/browser/resources/md_downloads:build",
|
||||
|
@ -142,7 +142,7 @@
|
||||
<include name="IDR_MD_DOWNLOADS_2X_INCOGNITO_MARKER_PNG" file="resources\md_downloads\2x\incognito_marker.png" type="BINDATA" />
|
||||
<include name="IDR_MD_DOWNLOADS_1X_NO_DOWNLOADS_PNG" file="resources\md_downloads\1x\no_downloads.png" type="BINDATA" />
|
||||
<include name="IDR_MD_DOWNLOADS_2X_NO_DOWNLOADS_PNG" file="resources\md_downloads\2x\no_downloads.png" type="BINDATA" />
|
||||
<if expr="use_vulcanize">
|
||||
<if expr="optimize_webui">
|
||||
<then>
|
||||
<include name="IDR_MD_DOWNLOADS_VULCANIZED_HTML" file="${root_gen_dir}\chrome\browser\resources\md_downloads\vulcanized.html" use_base_dir="false" flattenhtml="true" allowexternalscript="true" type="BINDATA" compress="gzip" />
|
||||
<include name="IDR_MD_DOWNLOADS_CRISPER_JS" file="${root_gen_dir}\chrome\browser\resources\md_downloads\crisper.js" use_base_dir="false" flattenhtml="true" type="BINDATA" compress="gzip" />
|
||||
@ -249,7 +249,7 @@
|
||||
<!-- MD Bookmarks. -->
|
||||
<include name="IDR_MD_BOOKMARKS_IMAGES_FOLDER_OPEN_SVG" file="resources\md_bookmarks\images\folder_open.svg" type="BINDATA" />
|
||||
<include name="IDR_MD_BOOKMARKS_IMAGES_FOLDER_SVG" file="resources\md_bookmarks\images\folder.svg" type="BINDATA" />
|
||||
<if expr="use_vulcanize">
|
||||
<if expr="optimize_webui">
|
||||
<then>
|
||||
<include name="IDR_MD_BOOKMARKS_VULCANIZED_HTML" file="${root_gen_dir}\chrome\browser\resources\md_bookmarks\vulcanized.html" use_base_dir="false" flattenhtml="true" allowexternalscript="true" type="BINDATA" compress="gzip" />
|
||||
<include name="IDR_MD_BOOKMARKS_CRISPER_JS" file="${root_gen_dir}\chrome\browser\resources\md_bookmarks\crisper.js" use_base_dir="false" flattenhtml="true" type="BINDATA" compress="gzip" />
|
||||
@ -310,7 +310,7 @@
|
||||
<include name="IDR_MD_HISTORY_HISTORY_JS" file="resources\md_history\history.js" type="BINDATA" />
|
||||
<include name="IDR_MD_HISTORY_IMAGES_100_SIGN_IN_PROMO_JPG" file="resources\md_history\images\100\sign_in_promo.jpg" type="BINDATA" />
|
||||
<include name="IDR_MD_HISTORY_IMAGES_200_SIGN_IN_PROMO_JPG" file="resources\md_history\images\200\sign_in_promo.jpg" type="BINDATA" />
|
||||
<if expr="use_vulcanize">
|
||||
<if expr="optimize_webui">
|
||||
<then>
|
||||
<include name="IDR_MD_HISTORY_APP_VULCANIZED_HTML" file="${root_gen_dir}\chrome\browser\resources\md_history\app.vulcanized.html" flattenhtml="true" allowexternalscript="true" type="BINDATA" compress="gzip" use_base_dir="false" />
|
||||
<include name="IDR_MD_HISTORY_APP_CRISPER_JS" file="${root_gen_dir}\chrome\browser\resources\md_history\app.crisper.js" flattenhtml="true" allowexternalscript="true" type="BINDATA" compress="gzip" use_base_dir="false" />
|
||||
|
@ -95,7 +95,7 @@ if (!is_android) {
|
||||
}
|
||||
|
||||
grit("settings_resources") {
|
||||
if (use_vulcanize) {
|
||||
if (optimize_webui) {
|
||||
source = "settings/settings_resources_vulcanized.grd"
|
||||
|
||||
# The .grd contains references to generated files.
|
||||
|
@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>$i18n{settings}</title>
|
||||
<if expr="not use_vulcanize">
|
||||
<if expr="not optimize_webui">
|
||||
<base href="chrome://$i18n{hostname}">
|
||||
</if>
|
||||
<style>
|
||||
|
@ -128,7 +128,7 @@ content::WebUIDataSource* CreateMdBookmarksUIHTMLSource(Profile* profile) {
|
||||
IDR_MD_BOOKMARKS_IMAGES_FOLDER_OPEN_SVG);
|
||||
source->AddResourcePath("images/folder.svg",
|
||||
IDR_MD_BOOKMARKS_IMAGES_FOLDER_SVG);
|
||||
#if BUILDFLAG(USE_VULCANIZE)
|
||||
#if BUILDFLAG(OPTIMIZE_WEBUI)
|
||||
source->AddResourcePath("crisper.js", IDR_MD_BOOKMARKS_CRISPER_JS);
|
||||
source->SetDefaultResource(IDR_MD_BOOKMARKS_VULCANIZED_HTML);
|
||||
source->UseGzip({"images/folder_open.svg", "images/folder.svg"});
|
||||
|
@ -103,7 +103,7 @@ content::WebUIDataSource* CreateDownloadsUIHTMLSource(Profile* profile) {
|
||||
source->AddResourcePath("2x/no_downloads.png",
|
||||
IDR_MD_DOWNLOADS_2X_NO_DOWNLOADS_PNG);
|
||||
|
||||
#if BUILDFLAG(USE_VULCANIZE)
|
||||
#if BUILDFLAG(OPTIMIZE_WEBUI)
|
||||
source->UseGzip({"1x/incognito_marker.png", "1x/no_downloads.png",
|
||||
"2x/incognito_marker.png", "2x/no_downloads.png"});
|
||||
|
||||
|
@ -137,7 +137,7 @@ content::WebUIDataSource* CreateMdHistoryUIHTMLSource(Profile* profile,
|
||||
IDR_MD_HISTORY_IMAGES_100_SIGN_IN_PROMO_JPG},
|
||||
{"images/200/sign_in_promo.jpg",
|
||||
IDR_MD_HISTORY_IMAGES_200_SIGN_IN_PROMO_JPG},
|
||||
#if !BUILDFLAG(USE_VULCANIZE)
|
||||
#if !BUILDFLAG(OPTIMIZE_WEBUI)
|
||||
{"app.html", IDR_MD_HISTORY_APP_HTML},
|
||||
{"app.js", IDR_MD_HISTORY_APP_JS},
|
||||
{"browser_service.html", IDR_MD_HISTORY_BROWSER_SERVICE_HTML},
|
||||
@ -174,7 +174,7 @@ content::WebUIDataSource* CreateMdHistoryUIHTMLSource(Profile* profile,
|
||||
}
|
||||
source->UseGzip(exclude_from_gzip);
|
||||
|
||||
#if BUILDFLAG(USE_VULCANIZE)
|
||||
#if BUILDFLAG(OPTIMIZE_WEBUI)
|
||||
source->AddResourcePath("app.html",
|
||||
IDR_MD_HISTORY_APP_VULCANIZED_HTML);
|
||||
source->AddResourcePath("app.crisper.js",
|
||||
|
@ -114,7 +114,7 @@ void MdSettingsUI::RegisterProfilePrefs(
|
||||
MdSettingsUI::MdSettingsUI(content::WebUI* web_ui)
|
||||
: content::WebUIController(web_ui),
|
||||
WebContentsObserver(web_ui->GetWebContents()) {
|
||||
#if BUILDFLAG(USE_VULCANIZE)
|
||||
#if BUILDFLAG(OPTIMIZE_WEBUI)
|
||||
std::vector<std::string> exclude_from_gzip;
|
||||
#endif
|
||||
|
||||
@ -207,7 +207,7 @@ MdSettingsUI::MdSettingsUI(content::WebUI* web_ui)
|
||||
|
||||
html_source->AddResourcePath("partner-logo.svg",
|
||||
IDR_CHROME_CLEANUP_PARTNER);
|
||||
#if BUILDFLAG(USE_VULCANIZE)
|
||||
#if BUILDFLAG(OPTIMIZE_WEBUI)
|
||||
exclude_from_gzip.push_back("partner-logo.svg");
|
||||
#endif
|
||||
#endif // defined(GOOGLE_CHROME_BUILD)
|
||||
@ -273,7 +273,7 @@ MdSettingsUI::MdSettingsUI(content::WebUI* web_ui)
|
||||
// Add the metrics handler to write uma stats.
|
||||
web_ui->AddMessageHandler(base::MakeUnique<MetricsHandler>());
|
||||
|
||||
#if BUILDFLAG(USE_VULCANIZE)
|
||||
#if BUILDFLAG(OPTIMIZE_WEBUI)
|
||||
html_source->AddResourcePath("crisper.js", IDR_MD_SETTINGS_CRISPER_JS);
|
||||
html_source->AddResourcePath("lazy_load.crisper.js",
|
||||
IDR_MD_SETTINGS_LAZY_LOAD_CRISPER_JS);
|
||||
|
@ -46,7 +46,7 @@ buildflag_header("features") {
|
||||
"ENABLE_SUPERVISED_USERS=$enable_supervised_users",
|
||||
"ENABLE_WAYLAND_SERVER=$enable_wayland_server",
|
||||
"PGO_BUILD=$pgo_build",
|
||||
"USE_VULCANIZE=$use_vulcanize",
|
||||
"OPTIMIZE_WEBUI=$optimize_webui",
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -74,9 +74,8 @@ declare_args() {
|
||||
|
||||
# Optimize parts of Chrome's UI written with web technologies (HTML/CSS/JS)
|
||||
# for runtime performance purposes. This does more work at compile time for
|
||||
# speed benefits at runtime (so we skip in debug builds). TODO(dbeam): rename
|
||||
# this flag "optimize_web_uis" because we run more than vulcanize these days.
|
||||
use_vulcanize = !is_debug
|
||||
# speed benefits at runtime (so we skip in debug builds).
|
||||
optimize_webui = !is_debug
|
||||
}
|
||||
|
||||
# Use brlapi from brltty for braille display support.
|
||||
@ -101,5 +100,5 @@ chrome_grit_defines = [
|
||||
"enable_vr=$enable_vr",
|
||||
"mac_views_browser=$mac_views_browser",
|
||||
"safe_browsing_mode=$safe_browsing_mode",
|
||||
"use_vulcanize=$use_vulcanize",
|
||||
"optimize_webui=$optimize_webui",
|
||||
]
|
||||
|
@ -6,7 +6,7 @@ In order to build with a fast configuration, try setting these options in your
|
||||
GN args:
|
||||
|
||||
```
|
||||
use_vulcanize = true
|
||||
optimize_webui = true
|
||||
is_debug = false
|
||||
```
|
||||
|
||||
|
Reference in New Issue
Block a user