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

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

Issue 2223443002: Fix WebApkInstaller so that it can talk to the server (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge branch 'master' into webapk_builder_impl3 Created 4 years, 4 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.h
diff --git a/chrome/browser/android/webapk/webapk_installer.h b/chrome/browser/android/webapk/webapk_installer.h
index 35046dc8c18afb87d6682cae290dc546487ccb9f..b4afd0be77b55e6e44a7a1d18bc0873cfc1dd883 100644
--- a/chrome/browser/android/webapk/webapk_installer.h
+++ b/chrome/browser/android/webapk/webapk_installer.h
@@ -32,7 +32,7 @@ class URLRequestContextGetter;
}
namespace webapk {
-class CreateWebApkRequest;
+class WebApk;
}
// Talks to Chrome WebAPK server and Google Play to generate a WebAPK on the
@@ -59,6 +59,9 @@ class WebApkInstaller : public net::URLFetcherDelegate {
net::URLRequestContextGetter* request_context_getter,
const FinishCallback& callback);
+ // Sets the timeout for the server requests.
+ void SetTimeoutMs(int timeout_ms);
+
protected:
// Starts installation of the downloaded WebAPK. Returns whether the install
// could be started. The installation may still fail if true is returned.
@@ -83,7 +86,7 @@ class WebApkInstaller : public net::URLFetcherDelegate {
// Called with the URL of generated WebAPK and the package name that the
// WebAPK should be installed at.
- void OnGotWebApkDownloadUrl(const std::string& download_url,
+ void OnGotWebApkDownloadUrl(const GURL& download_url,
const std::string& package_name);
// Called once the WebAPK has been downloaded. Installs the WebAPK if the
@@ -94,8 +97,8 @@ class WebApkInstaller : public net::URLFetcherDelegate {
const std::string& package_name,
FileDownloader::Result result);
- // Populates webapk::CreateWebApkRequest and returns it.
- std::unique_ptr<webapk::CreateWebApkRequest> BuildCreateWebApkRequest();
+ // Populates webapk::WebApk and returns it.
+ std::unique_ptr<webapk::WebApk> BuildWebApkProto();
// Called when the request to the WebAPK server times out or when the WebAPK
// download times out.
@@ -134,6 +137,13 @@ class WebApkInstaller : public net::URLFetcherDelegate {
// WebAPK server URL.
GURL server_url_;
+ // The number of milliseconds to wait for the WebAPK download URL from the
+ // WebAPK server.
+ int webapk_download_url_timeout_ms_;
+
+ // The number of milliseconds to wait for the WebAPK download to complete.
+ int download_timeout_ms_;
+
// Used to get |weak_ptr_| on the IO thread.
base::WeakPtrFactory<WebApkInstaller> io_weak_ptr_factory_;

Powered by Google App Engine
This is Rietveld 408576698