Chromium Code Reviews| 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..369382755eac75bf6c93cbadac4e9be26bc9e4b3 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=%s" + net::EscapeQueryParamValue(api_key, true)); |
|
mattm
2013/09/23 21:37:00
remove %s
Mattias Nissler (ping if slow)
2013/09/24 08:53:29
Done.
akalin
2013/09/25 21:35:38
did tests catch this? if not, that's worrisome :/
Mattias Nissler (ping if slow)
2013/09/26 08:48:10
AFAICS, they didn't.
|
| + |
| return url; |
| } |