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 07c07cc1b186e29f27837258dd0063eba285c9b4..5792432e6e24d69069ca42ddbfd98100d712c815 100644 |
--- a/chrome/browser/android/webapk/webapk_installer.cc |
+++ b/chrome/browser/android/webapk/webapk_installer.cc |
@@ -184,20 +184,23 @@ void WebApkInstaller::SetTimeoutMs(int timeout_ms) { |
void WebApkInstaller::UpdateAsync(content::BrowserContext* browser_context, |
const FinishCallback& finish_callback, |
+ const std::string& icon_murmur2_hash, |
const std::string& webapk_package, |
int webapk_version) { |
UpdateAsyncWithURLRequestContextGetter( |
Profile::FromBrowserContext(browser_context)->GetRequestContext(), |
- finish_callback, webapk_package, webapk_version); |
+ finish_callback, icon_murmur2_hash, webapk_package, webapk_version); |
} |
void WebApkInstaller::UpdateAsyncWithURLRequestContextGetter( |
net::URLRequestContextGetter* request_context_getter, |
const FinishCallback& finish_callback, |
+ const std::string& icon_murmur2_hash, |
const std::string& webapk_package, |
int webapk_version) { |
request_context_getter_ = request_context_getter; |
finish_callback_ = finish_callback; |
+ shortcut_icon_murmur2_hash_ = icon_murmur2_hash; |
webapk_package_ = webapk_package; |
webapk_version_ = webapk_version; |
task_type_ = UPDATE; |
@@ -207,7 +210,12 @@ void WebApkInstaller::UpdateAsyncWithURLRequestContextGetter( |
return; |
} |
- DownloadAppIconAndComputeMurmur2Hash(); |
+ base::PostTaskAndReplyWithResult( |
+ GetBackgroundTaskRunner().get(), FROM_HERE, |
+ base::Bind(&BuildWebApkProtoInBackground, shortcut_info_, |
+ shortcut_icon_, shortcut_icon_murmur2_hash_), |
+ base::Bind(&WebApkInstaller::SendUpdateWebApkRequest, |
+ weak_ptr_factory_.GetWeakPtr())); |
} |
bool WebApkInstaller::StartInstallingDownloadedWebApk( |
@@ -278,21 +286,12 @@ void WebApkInstaller::OnGotIconMurmur2Hash( |
return; |
} |
- if (task_type_ == INSTALL) { |
- base::PostTaskAndReplyWithResult( |
- GetBackgroundTaskRunner().get(), FROM_HERE, |
- base::Bind(&BuildWebApkProtoInBackground, shortcut_info_, |
- shortcut_icon_, shortcut_icon_murmur2_hash_), |
- base::Bind(&WebApkInstaller::SendCreateWebApkRequest, |
- weak_ptr_factory_.GetWeakPtr())); |
- } else if (task_type_ == UPDATE) { |
- base::PostTaskAndReplyWithResult( |
- GetBackgroundTaskRunner().get(), FROM_HERE, |
- base::Bind(&BuildWebApkProtoInBackground, shortcut_info_, |
- shortcut_icon_, shortcut_icon_murmur2_hash_), |
- base::Bind(&WebApkInstaller::SendUpdateWebApkRequest, |
- weak_ptr_factory_.GetWeakPtr())); |
- } |
+ base::PostTaskAndReplyWithResult( |
+ GetBackgroundTaskRunner().get(), FROM_HERE, |
+ base::Bind(&BuildWebApkProtoInBackground, shortcut_info_, |
+ shortcut_icon_, shortcut_icon_murmur2_hash_), |
+ base::Bind(&WebApkInstaller::SendCreateWebApkRequest, |
+ weak_ptr_factory_.GetWeakPtr())); |
} |
void WebApkInstaller::SendCreateWebApkRequest( |