Index: chrome/browser/android/webapk/webapk_installer.cc |
diff --git a/chrome/browser/android/webapk/webapk_installer.cc b/chrome/browser/android/webapk/webapk_installer.cc |
index 2f24da1b1cf7ab5d8d4257f4e10afcbc6eacd6f6..04575686c1edd21dadc41a9a02ee8df08f6646ba 100644 |
--- a/chrome/browser/android/webapk/webapk_installer.cc |
+++ b/chrome/browser/android/webapk/webapk_installer.cc |
@@ -380,7 +380,10 @@ void WebApkInstaller::InstallAsync(const FinishCallback& finish_callback) { |
// |
// We redownload the icon in order to take the Murmur2 hash. The redownload |
// should be fast because the icon should be in the HTTP cache. |
- DownloadAppIconAndComputeMurmur2Hash(); |
+ WebApkIconHasher::DownloadAndComputeMurmur2Hash( |
+ request_context_getter_, shortcut_info_.best_primary_icon_url, |
+ base::Bind(&WebApkInstaller::OnGotIconMurmur2Hash, |
+ weak_ptr_factory_.GetWeakPtr())); |
} |
void WebApkInstaller::UpdateAsync( |
@@ -449,18 +452,8 @@ void WebApkInstaller::OnURLFetchComplete(const net::URLFetcher* source) { |
OnGotWebApkDownloadUrl(signed_download_url, response->package_name()); |
} |
-void WebApkInstaller::DownloadAppIconAndComputeMurmur2Hash() { |
- icon_hasher_.reset(new WebApkIconHasher( |
- request_context_getter_, shortcut_info_.best_primary_icon_url, |
- base::Bind(&WebApkInstaller::OnGotIconMurmur2Hash, |
- weak_ptr_factory_.GetWeakPtr()))); |
- icon_hasher_->DownloadAndComputeMurmur2Hash(); |
-} |
- |
void WebApkInstaller::OnGotIconMurmur2Hash( |
const std::string& icon_murmur2_hash) { |
- icon_hasher_.reset(); |
- |
// An empty hash indicates that |icon_hasher_| encountered an error. |
if (icon_murmur2_hash.empty()) { |
OnResult(WebApkInstallResult::FAILURE); |