Reland "android: Do not compress locale .pak files inside bundle splits."
This was reverted because it caused startup crashes on non-monochrome bundle APKs (http://crbug.com/953932). The reason for the crash was that the ProductConfig.UNCOMPRESSED_LOCALES was empty for non-monochrome APKs. The only reason this worked on monochrome was because monochrome happens to include webview resources uncompressed. Now we make sure to add locale paks to bundle APKs uncompressed, which correctly fills out ProductConfig.UNCOMPRESSED_LOCALES. In addition, I added a task to clean up the old extracted files if we detect they are no longer needed. Diffs from original patch are from Patchset 1 on. Original change's description: > android: Do not compress locale .pak files inside bundle splits. > > This CL ensures that the locale-related pak files stored in > app bundle splits are stored uncompressed inside the language-based > splits (e.g. base-fr.apk for the French language), and are read > directly from it. > > Benefits include: > - Less disk i/o during Chrome startup for bundles. > > - Reduced overall install size, since the corresponding files > need not be extracted. I.e. since the compression ratio is > roughly 50% for locale .pak files, we have something like. > > Before: compressed 50 kiB (APK) + uncompressed 100 kiB (/data) > After: uncompressed 100 kiB (APK) > > However, this increases the size of the base and split apks slightly. > > In more details: > > - Modify create_app_bundle.py to ensure that the split-specific > locale .pak files are never compressed. > > Also, move the en-GB.pak file location from fallback-locales/ > to the split-specific locales#lang_en/, this ensures that the > file will end up in the English-based split (base-en.apk) > instead. > > - Modify ResourceExtractor.java to only extract the locale .pak > files in regular APKs, ignoring the ones from bundles. Also make > the log messages disappear unless the DEBUG final variable is > set to true (less logs are always better for startup time). > > - Modify ResourceBundle.java to check for the presence of > split-specific locale .pak files as well, and to also check > that the corresponding file path being returned actually > exists inside the apk or bundle. > > - Modify ResourceBundle::LoadLocaleResources() to try loading > the split-specific locale pak files before the extracted version > if available, and add a technical note explaining what the code > is trying to do (it is sufficiently subtle to be explained). > > - Add missing dependencies to the vr_android_unittests and > shell_dialogs_unittest targets. They otherwise fail to > build due to http://crbug.com/951419. > > BUG=933943,933962, 951419 > R=agrieve@chromium.org,yfriedman@chromium.org,estevenson@chromium.org,benmason@chromium.org,dtrainor@chromium.org,jaekyun@chromium.org > TBR=sky@chromium.org > > Change-Id: I02c1688b8f8ed8f62cfdaa1f12c2ea15f8198e4a > Binary-Size: Increments overall bundle size by 100 kiB, but reduces overall install size by about 50% of that. > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1514684 > Commit-Queue: David Turner <digit@chromium.org> > Reviewed-by: Tibor Goldschwendt <tiborg@chromium.org> > Reviewed-by: David Trainor <dtrainor@chromium.org> > Reviewed-by: Andrew Grieve <agrieve@chromium.org> > Cr-Commit-Position: refs/heads/master@{#650753} Bug: 933943, 933962 Binary-Size: Increments overall bundle size by 100 kiB, but reduces overall install size by about 50% of that. Change-Id: If85211fa83809d814eb55fe66d81becc1723d9a0 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1918367 Commit-Queue: Clark DuVall <cduvall@chromium.org> Reviewed-by:Scott Violet <sky@chromium.org> Reviewed-by:
Andrew Grieve <agrieve@chromium.org> Cr-Commit-Position: refs/heads/master@{#715915}
Showing
Please register or sign in to comment