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..f61a6175d0f89577f73614f94d178ca7b4aa8979 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,13 +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()); |
| + url = url.Resolve(base::StringPrintf( |
| + "?key=%s", net::EscapeQueryParamValue(api_key, true).c_str())); |
|
akalin
2013/09/19 18:54:00
nit -- no need for StringPrintf, can just do "?key
Mattias Nissler (ping if slow)
2013/09/20 15:33:53
Done.
|
| } |
| return url; |
| } |