From https://codereview.chromium.org/2331773002/
Making
WebContents::DownloadImage return a hash is also suboptimal because then there
would be redundant work for a bunch of other places which use that method.
Instead, would it be sufficient to change InstallableManager and have it run
ManifestIconSelector::FindBestMatchingIcon when
InstallableParams::check_installable is true? Then the upgrade detector would
not fetch an icon, but it would have the URL which it could then pass off to the
hasher. If the hash comes back different we'd need to run InstallableManager
again to get the icon.
This doesn't solve the redownloading when you install the WebAPK initially to
compute the hash for the first time, but it'll make each subsequent upgrade
request more efficient (I'm imagining that WebAPKs won't need to be upgraded too
often, so this will halve the number of image bytes each upgrade request has to
fetch).