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

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

Issue 2408263002: Make install and update WebAPK URLs the same (Closed)
Patch Set: Merge branch 'master' into webapk_installer_update Created 4 years, 2 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
« no previous file with comments | « no previous file | chrome/browser/android/webapk/webapk_installer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 403297873b469a9e96ed2854038716e31e891f71..fe8dc223e474662a4a82ca8a4979ebbeea9d0e3d 100644
--- a/chrome/browser/android/webapk/webapk_installer.cc
+++ b/chrome/browser/android/webapk/webapk_installer.cc
@@ -36,10 +36,7 @@ namespace {
// The default WebAPK server URL.
const char kDefaultWebApkServerUrl[] =
- "https://webapk.googleapis.com/v1alpha/webApks/";
-
-// The response format type expected from the WebAPK server.
-const char kDefaultWebApkServerUrlResponseType[] = "?alt=proto";
+ "https://webapk.googleapis.com/v1alpha/webApks/?alt=proto";
// The MIME type of the POST data sent to the server.
const char kProtoMimeType[] = "application/x-protobuf";
@@ -125,13 +122,6 @@ scoped_refptr<base::TaskRunner> GetBackgroundTaskRunner() {
base::SequencedWorkerPool::SKIP_ON_SHUTDOWN);
}
-GURL GetServerUrlForUpdate(const GURL& server_url,
- const std::string& webapk_package) {
- // crbug.com/636552. Simplify the server URL.
- return GURL(server_url.spec() + webapk_package + "/" +
- kDefaultWebApkServerUrlResponseType);
-}
-
// Creates a directory depending on the type of the task, and set permissions.
// It also creates any parent directory along the path if doesn't exist,
// and sets permissions as well.
@@ -353,8 +343,7 @@ void WebApkInstaller::OnGotIconMurmur2Hash(
void WebApkInstaller::SendCreateWebApkRequest(
std::unique_ptr<webapk::WebApk> webapk) {
- GURL server_url(server_url_.spec() + kDefaultWebApkServerUrlResponseType);
- SendRequest(std::move(webapk), net::URLFetcher::POST, server_url);
+ SendRequest(std::move(webapk), net::URLFetcher::POST, server_url_);
}
void WebApkInstaller::SendUpdateWebApkRequest(
@@ -362,8 +351,7 @@ void WebApkInstaller::SendUpdateWebApkRequest(
webapk->set_package_name(webapk_package_);
webapk->set_version(std::to_string(webapk_version_));
- SendRequest(std::move(webapk), net::URLFetcher::PUT,
- GetServerUrlForUpdate(server_url_, webapk_package_));
+ SendRequest(std::move(webapk), net::URLFetcher::PUT, server_url_);
}
void WebApkInstaller::SendRequest(std::unique_ptr<webapk::WebApk> request_proto,
« no previous file with comments | « no previous file | chrome/browser/android/webapk/webapk_installer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698