| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/safe_browsing/ping_manager.h" | 5 #include "chrome/browser/safe_browsing/ping_manager.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 const char kExtendedReportingUploadUrl[] = | 28 const char kExtendedReportingUploadUrl[] = |
| 29 "https://sb-ssl.google.com/safebrowsing/clientreport/chrome-certs"; | 29 "https://sb-ssl.google.com/safebrowsing/clientreport/chrome-certs"; |
| 30 } // namespace | 30 } // namespace |
| 31 | 31 |
| 32 // SafeBrowsingPingManager implementation ---------------------------------- | 32 // SafeBrowsingPingManager implementation ---------------------------------- |
| 33 | 33 |
| 34 // static | 34 // static |
| 35 SafeBrowsingPingManager* SafeBrowsingPingManager::Create( | 35 SafeBrowsingPingManager* SafeBrowsingPingManager::Create( |
| 36 net::URLRequestContextGetter* request_context_getter, | 36 net::URLRequestContextGetter* request_context_getter, |
| 37 const SafeBrowsingProtocolConfig& config) { | 37 const SafeBrowsingProtocolConfig& config) { |
| 38 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 38 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 39 return new SafeBrowsingPingManager(request_context_getter, config); | 39 return new SafeBrowsingPingManager(request_context_getter, config); |
| 40 } | 40 } |
| 41 | 41 |
| 42 SafeBrowsingPingManager::SafeBrowsingPingManager( | 42 SafeBrowsingPingManager::SafeBrowsingPingManager( |
| 43 net::URLRequestContextGetter* request_context_getter, | 43 net::URLRequestContextGetter* request_context_getter, |
| 44 const SafeBrowsingProtocolConfig& config) | 44 const SafeBrowsingProtocolConfig& config) |
| 45 : client_name_(config.client_name), | 45 : client_name_(config.client_name), |
| 46 request_context_getter_(request_context_getter), | 46 request_context_getter_(request_context_getter), |
| 47 url_prefix_(config.url_prefix), | 47 url_prefix_(config.url_prefix), |
| 48 certificate_error_reporter_( | 48 certificate_error_reporter_( |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 url_prefix_.c_str(), | 175 url_prefix_.c_str(), |
| 176 client_name_.c_str(), | 176 client_name_.c_str(), |
| 177 version_.c_str()); | 177 version_.c_str()); |
| 178 std::string api_key = google_apis::GetAPIKey(); | 178 std::string api_key = google_apis::GetAPIKey(); |
| 179 if (!api_key.empty()) { | 179 if (!api_key.empty()) { |
| 180 base::StringAppendF(&url, "&key=%s", | 180 base::StringAppendF(&url, "&key=%s", |
| 181 net::EscapeQueryParamValue(api_key, true).c_str()); | 181 net::EscapeQueryParamValue(api_key, true).c_str()); |
| 182 } | 182 } |
| 183 return GURL(url); | 183 return GURL(url); |
| 184 } | 184 } |
| OLD | NEW |