Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(108)

Unified Diff: chrome/browser/android/webapk/webapk_installer.cc

Issue 2746723002: [WebAPK] Refactor "unsigned sources" installation path (Closed)
Patch Set: Merge branch 'start0' into start Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 90ea2332001c96152df55b3422b0c0d2429f991d..6bed41611db9b142665cef71fb53369081dc0662 100644
--- a/chrome/browser/android/webapk/webapk_installer.cc
+++ b/chrome/browser/android/webapk/webapk_installer.cc
@@ -293,19 +293,19 @@ bool WebApkInstaller::Register(JNIEnv* env) {
return RegisterNativesImpl(env);
}
-bool WebApkInstaller::StartInstallingDownloadedWebApk(
+void WebApkInstaller::InstallDownloadedWebApk(
JNIEnv* env,
const base::android::ScopedJavaLocalRef<jstring>& java_file_path,
const base::android::ScopedJavaLocalRef<jstring>& java_package_name) {
- return Java_WebApkInstaller_installAsyncAndMonitorInstallationFromNative(
+ Java_WebApkInstaller_installDownloadedWebApkAsync(
env, java_ref_, java_file_path, java_package_name);
}
-bool WebApkInstaller::StartUpdateUsingDownloadedWebApk(
+void WebApkInstaller::UpdateUsingDownloadedWebApk(
JNIEnv* env,
const base::android::ScopedJavaLocalRef<jstring>& java_file_path) {
- return Java_WebApkInstaller_updateAsyncFromNative(env, java_ref_,
- java_file_path);
+ Java_WebApkInstaller_updateUsingDownloadedWebApkAsync(env, java_ref_,
+ java_file_path);
}
bool WebApkInstaller::CanUseGooglePlayInstallService() {
@@ -605,21 +605,11 @@ void WebApkInstaller::OnWebApkMadeWorldReadable(
base::android::ConvertUTF8ToJavaString(env, file_path.value());
base::android::ScopedJavaLocalRef<jstring> java_package_name =
base::android::ConvertUTF8ToJavaString(env, webapk_package_);
- bool success = false;
if (task_type_ == INSTALL) {
- success =
- StartInstallingDownloadedWebApk(env, java_file_path, java_package_name);
- } else if (task_type_ == UPDATE) {
- success = StartUpdateUsingDownloadedWebApk(env, java_file_path);
- if (success) {
- // Since WebApkInstaller doesn't listen to WebAPKs' update events
- // we call OnSuccess() as long as the update started successfully.
- OnSuccess();
- return;
- }
+ InstallDownloadedWebApk(env, java_file_path, java_package_name);
+ return;
dominickn 2017/03/13 23:13:37 Nit: move the webapk_package_ conversion into the
}
- if (!success)
- OnFailure();
+ UpdateUsingDownloadedWebApk(env, java_file_path);
}
void WebApkInstaller::OnTimeout() {

Powered by Google App Engine
This is Rietveld 408576698