Commit 775f2fb6 authored by sullivan's avatar sullivan Committed by Commit Bot

gzip chrome://tracing resources.

Compiling locally, resources.pak goes from 16744913 bytes to 14952341
(nearly 1.8MiB savings).

Review-Url: https://codereview.chromium.org/2933483005
Cr-Commit-Position: refs/heads/master@{#478678}
parent 21f50494
...@@ -58,6 +58,7 @@ def add_file_to_grd(grd_doc, filename): ...@@ -58,6 +58,7 @@ def add_file_to_grd(grd_doc, filename):
new_include_node.setAttribute('name', make_name_from_filename(filename)) new_include_node.setAttribute('name', make_name_from_filename(filename))
new_include_node.setAttribute('file', filename) new_include_node.setAttribute('file', filename)
new_include_node.setAttribute('type', 'BINDATA') new_include_node.setAttribute('type', 'BINDATA')
new_include_node.setAttribute('compress', 'gzip')
new_include_node.setAttribute('flattenhtml', 'true') new_include_node.setAttribute('flattenhtml', 'true')
if filename.endswith('.html'): if filename.endswith('.html'):
new_include_node.setAttribute('allowexternalscript', 'true') new_include_node.setAttribute('allowexternalscript', 'true')
......
...@@ -240,6 +240,13 @@ TracingUI::TracingUI(WebUI* web_ui) ...@@ -240,6 +240,13 @@ TracingUI::TracingUI(WebUI* web_ui)
web_ui->GetWebContents()->GetBrowserContext(); web_ui->GetWebContents()->GetBrowserContext();
WebUIDataSource* source = WebUIDataSource::Create(kChromeUITracingHost); WebUIDataSource* source = WebUIDataSource::Create(kChromeUITracingHost);
std::unordered_set<std::string> exclusions;
exclusions.insert("json/begin_recording");
exclusions.insert("json/categories");
exclusions.insert("json/end_recording_compressed");
exclusions.insert("json/get_buffer_percent_full");
exclusions.insert("json/get_buffer_status");
source->UseGzip(exclusions);
source->SetJsonPath("strings.js"); source->SetJsonPath("strings.js");
source->SetDefaultResource(IDR_TRACING_HTML); source->SetDefaultResource(IDR_TRACING_HTML);
source->AddResourcePath("tracing.js", IDR_TRACING_JS); source->AddResourcePath("tracing.js", IDR_TRACING_JS);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment