| Index: chrome/browser/safe_browsing/download_protection_service.cc
|
| diff --git a/chrome/browser/safe_browsing/download_protection_service.cc b/chrome/browser/safe_browsing/download_protection_service.cc
|
| index 473dc5348dfdb212a1c46065a7802e2c29237a93..37370dc2598069850be3a354237409a403072907 100644
|
| --- a/chrome/browser/safe_browsing/download_protection_service.cc
|
| +++ b/chrome/browser/safe_browsing/download_protection_service.cc
|
| @@ -660,7 +660,7 @@ class DownloadProtectionService::CheckClientDownloadRequest
|
| VLOG(2) << "Sending a request for URL: "
|
| << item_->GetUrlChain().back();
|
| fetcher_.reset(net::URLFetcher::Create(0 /* ID used for testing */,
|
| - GURL(GetDownloadRequestUrl()),
|
| + GetDownloadRequestUrl(),
|
| net::URLFetcher::POST,
|
| this));
|
| fetcher_->SetLoadFlags(net::LOAD_DISABLE_CACHE);
|
| @@ -967,13 +967,12 @@ void DownloadProtectionService::GetCertificateWhitelistStrings(
|
| }
|
|
|
| // static
|
| -std::string DownloadProtectionService::GetDownloadRequestUrl() {
|
| - std::string url = kDownloadRequestUrl;
|
| +GURL DownloadProtectionService::GetDownloadRequestUrl() {
|
| + GURL url(kDownloadRequestUrl);
|
| std::string api_key = google_apis::GetAPIKey();
|
| - if (!api_key.empty()) {
|
| - base::StringAppendF(&url, "?key=%s",
|
| - net::EscapeQueryParamValue(api_key, true).c_str());
|
| - }
|
| + if (!api_key.empty())
|
| + url = url.Resolve("?key=" + net::EscapeQueryParamValue(api_key, true));
|
| +
|
| return url;
|
| }
|
|
|
|
|