| 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 15 matching lines...) Expand all Loading... |
| 26 // URLs to upload invalid certificate chain reports. The HTTP URL is | 26 // URLs to upload invalid certificate chain reports. The HTTP URL is |
| 27 // preferred since a client seeing an invalid cert might not be able to | 27 // preferred since a client seeing an invalid cert might not be able to |
| 28 // make an HTTPS connection to report it. | 28 // make an HTTPS connection to report it. |
| 29 const char kExtendedReportingUploadUrlInsecure[] = | 29 const char kExtendedReportingUploadUrlInsecure[] = |
| 30 "http://safebrowsing.googleusercontent.com/safebrowsing/clientreport/" | 30 "http://safebrowsing.googleusercontent.com/safebrowsing/clientreport/" |
| 31 "chrome-certs"; | 31 "chrome-certs"; |
| 32 const char kExtendedReportingUploadUrlSecure[] = | 32 const char kExtendedReportingUploadUrlSecure[] = |
| 33 "https://sb-ssl.google.com/safebrowsing/clientreport/chrome-certs"; | 33 "https://sb-ssl.google.com/safebrowsing/clientreport/chrome-certs"; |
| 34 } // namespace | 34 } // namespace |
| 35 | 35 |
| 36 namespace safe_browsing { |
| 37 |
| 36 // SafeBrowsingPingManager implementation ---------------------------------- | 38 // SafeBrowsingPingManager implementation ---------------------------------- |
| 37 | 39 |
| 38 // static | 40 // static |
| 39 SafeBrowsingPingManager* SafeBrowsingPingManager::Create( | 41 SafeBrowsingPingManager* SafeBrowsingPingManager::Create( |
| 40 net::URLRequestContextGetter* request_context_getter, | 42 net::URLRequestContextGetter* request_context_getter, |
| 41 const SafeBrowsingProtocolConfig& config) { | 43 const SafeBrowsingProtocolConfig& config) { |
| 42 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 44 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 43 return new SafeBrowsingPingManager(request_context_getter, config); | 45 return new SafeBrowsingPingManager(request_context_getter, config); |
| 44 } | 46 } |
| 45 | 47 |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 url_prefix_.c_str(), | 199 url_prefix_.c_str(), |
| 198 client_name_.c_str(), | 200 client_name_.c_str(), |
| 199 version_.c_str()); | 201 version_.c_str()); |
| 200 std::string api_key = google_apis::GetAPIKey(); | 202 std::string api_key = google_apis::GetAPIKey(); |
| 201 if (!api_key.empty()) { | 203 if (!api_key.empty()) { |
| 202 base::StringAppendF(&url, "&key=%s", | 204 base::StringAppendF(&url, "&key=%s", |
| 203 net::EscapeQueryParamValue(api_key, true).c_str()); | 205 net::EscapeQueryParamValue(api_key, true).c_str()); |
| 204 } | 206 } |
| 205 return GURL(url); | 207 return GURL(url); |
| 206 } | 208 } |
| 209 |
| 210 } // namespace safe_browsing |
| OLD | NEW |