Commit 88eb893d authored by pkotwicz's avatar pkotwicz Committed by Commit bot

Send POST request to update WebAPK instead of PUT request

BUG=None
TEST=Manual

Review-Url: https://chromiumcodereview.appspot.com/2436833002
Cr-Commit-Position: refs/heads/master@{#426538}
parent e61bdf47
...@@ -343,7 +343,7 @@ void WebApkInstaller::OnGotIconMurmur2Hash( ...@@ -343,7 +343,7 @@ void WebApkInstaller::OnGotIconMurmur2Hash(
void WebApkInstaller::SendCreateWebApkRequest( void WebApkInstaller::SendCreateWebApkRequest(
std::unique_ptr<webapk::WebApk> webapk) { std::unique_ptr<webapk::WebApk> webapk) {
SendRequest(std::move(webapk), net::URLFetcher::POST, server_url_); SendRequest(std::move(webapk), server_url_);
} }
void WebApkInstaller::SendUpdateWebApkRequest( void WebApkInstaller::SendUpdateWebApkRequest(
...@@ -351,18 +351,18 @@ void WebApkInstaller::SendUpdateWebApkRequest( ...@@ -351,18 +351,18 @@ void WebApkInstaller::SendUpdateWebApkRequest(
webapk->set_package_name(webapk_package_); webapk->set_package_name(webapk_package_);
webapk->set_version(std::to_string(webapk_version_)); webapk->set_version(std::to_string(webapk_version_));
SendRequest(std::move(webapk), net::URLFetcher::PUT, server_url_); SendRequest(std::move(webapk), server_url_);
} }
void WebApkInstaller::SendRequest(std::unique_ptr<webapk::WebApk> request_proto, void WebApkInstaller::SendRequest(std::unique_ptr<webapk::WebApk> request_proto,
net::URLFetcher::RequestType request_type,
const GURL& server_url) { const GURL& server_url) {
timer_.Start( timer_.Start(
FROM_HERE, FROM_HERE,
base::TimeDelta::FromMilliseconds(webapk_download_url_timeout_ms_), base::TimeDelta::FromMilliseconds(webapk_download_url_timeout_ms_),
base::Bind(&WebApkInstaller::OnTimeout, weak_ptr_factory_.GetWeakPtr())); base::Bind(&WebApkInstaller::OnTimeout, weak_ptr_factory_.GetWeakPtr()));
url_fetcher_ = net::URLFetcher::Create(server_url, request_type, this); url_fetcher_ =
net::URLFetcher::Create(server_url, net::URLFetcher::POST, this);
url_fetcher_->SetRequestContext(request_context_getter_); url_fetcher_->SetRequestContext(request_context_getter_);
std::string serialized_request; std::string serialized_request;
request_proto->SerializeToString(&serialized_request); request_proto->SerializeToString(&serialized_request);
......
...@@ -141,7 +141,6 @@ class WebApkInstaller : public net::URLFetcherDelegate { ...@@ -141,7 +141,6 @@ class WebApkInstaller : public net::URLFetcherDelegate {
// successful request the WebAPK server responds with the URL of the generated // successful request the WebAPK server responds with the URL of the generated
// WebAPK. // WebAPK.
void SendRequest(std::unique_ptr<webapk::WebApk> request_proto, void SendRequest(std::unique_ptr<webapk::WebApk> request_proto,
net::URLFetcher::RequestType request_type,
const GURL& server_url); const GURL& server_url);
// Called with the URL of generated WebAPK and the package name that the // Called with the URL of generated WebAPK and the package name that the
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment