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

Unified Diff: chrome/browser/safe_browsing/download_protection_service.cc

Issue 23625015: Consolidate TestURLFetcherFactory::SetFakeResponse (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 7 years, 3 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/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;
}
« no previous file with comments | « chrome/browser/safe_browsing/download_protection_service.h ('k') | chrome/browser/signin/signin_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698