Skip to content
Commit 6b6e20f6 authored by Samuel Huang's avatar Samuel Huang Committed by Commit Bot
Browse files

[DOM Distiller] Compress resources to save 86 kB on Android.

This CL compresses DOM distiller's resources, which reduces Chrome's
binary size by 86 kB on Android. Details:
* Add compress="gzip" to all dom_distiller_resoruces.grdp items.
* Add resource_utils.* with GetResrouceFromIdAsString() to centralize
  ui::ResourceBundle() usage, and perform uncompression.
* Ensure that all IDR_* usage go through GetResourceFromIdAsString().
  * Exception: WebUI (for chrome://dom-distiller), which uses
    content::WebUIDataSource, so decompression is already handled.

Also update third_party/zlib:
* Add GzipUncompress(base::StringPiece, std::string*), which
  allocates the output string (used by GetResrouceFromIdAsString()).
* Add CompressionUtilsTest::GzipUncompressionFromStringPieceToString.

Bug: 872559, 961866
Change-Id: I54f7f80bd3b90e9e0226901295043a25e714a938
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1606245


Commit-Queue: Samuel Huang <huangs@chromium.org>
Reviewed-by: default avatarAlexei Svitkine <asvitkine@chromium.org>
Reviewed-by: default avatarWei-Yin Chen (陳威尹) <wychen@chromium.org>
Reviewed-by: default avatarSamuel Huang <huangs@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#659695}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 400f6e823a75b4b8fada6e270071da8082527dc2
parent 8f2b9d41
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment