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

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

Issue 2746723002: [WebAPK] Refactor "unsigned sources" installation path (Closed)
Patch Set: Merge branch 'master' 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 c3d8b8e9a763e399367dcf55e9c92a2e6b0aab8e..1841c873fb236c93d099066254b7f66975f7ea35 100644
--- a/chrome/browser/android/webapk/webapk_installer.cc
+++ b/chrome/browser/android/webapk/webapk_installer.cc
@@ -294,19 +294,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() {
@@ -604,23 +604,13 @@ void WebApkInstaller::OnWebApkMadeWorldReadable(
JNIEnv* env = base::android::AttachCurrentThread();
base::android::ScopedJavaLocalRef<jstring> java_file_path =
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);
+ base::android::ScopedJavaLocalRef<jstring> java_package_name =
+ base::android::ConvertUTF8ToJavaString(env, webapk_package_);
+ InstallDownloadedWebApk(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;
- }
+ UpdateUsingDownloadedWebApk(env, java_file_path);
}
- if (!success)
- OnFailure();
}
void WebApkInstaller::OnTimeout() {
« no previous file with comments | « chrome/browser/android/webapk/webapk_installer.h ('k') | chrome/browser/android/webapk/webapk_installer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698