Chromium Code Reviews| Index: chrome/browser/safe_browsing/client_side_detection_service.cc |
| diff --git a/chrome/browser/safe_browsing/client_side_detection_service.cc b/chrome/browser/safe_browsing/client_side_detection_service.cc |
| index 543779f253ca69f911e90b929bff7600ee99f16c..c9d63dea239cd47f818c2f1ca09348abd3f76d58 100644 |
| --- a/chrome/browser/safe_browsing/client_side_detection_service.cc |
| +++ b/chrome/browser/safe_browsing/client_side_detection_service.cc |
| @@ -367,7 +367,7 @@ void ClientSideDetectionService::StartClientReportPhishingRequest( |
| net::URLFetcher* fetcher = net::URLFetcher::Create( |
| 0 /* ID used for testing */, |
| - GURL(GetClientReportUrl(kClientReportPhishingUrl)), |
| + GetClientReportUrl(kClientReportPhishingUrl), |
| net::URLFetcher::POST, this); |
| // Remember which callback and URL correspond to the current fetcher object. |
| @@ -417,7 +417,7 @@ void ClientSideDetectionService::StartClientReportMalwareRequest( |
| net::URLFetcher* fetcher = net::URLFetcher::Create( |
| 0 /* ID used for testing */, |
| - GURL(GetClientReportUrl(kClientReportMalwareUrl)), |
| + GetClientReportUrl(kClientReportMalwareUrl), |
| net::URLFetcher::POST, this); |
| // Remember which callback and URL correspond to the current fetcher object. |
| @@ -706,14 +706,13 @@ bool ClientSideDetectionService::ModelHasValidHashIds( |
| } |
| // static |
| -std::string ClientSideDetectionService::GetClientReportUrl( |
| +GURL ClientSideDetectionService::GetClientReportUrl( |
| const std::string& report_url) { |
| - std::string url = report_url; |
| + GURL url(report_url); |
| 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
Oops, thanks for pointing out. Done.
|
| + |
| return url; |
| } |
| } // namespace safe_browsing |