| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 | 92 |
| 93 SafeBrowsingPingManager::SafeBrowsingPingManager( | 93 SafeBrowsingPingManager::SafeBrowsingPingManager( |
| 94 net::URLRequestContextGetter* request_context_getter, | 94 net::URLRequestContextGetter* request_context_getter, |
| 95 const SafeBrowsingProtocolConfig& config) | 95 const SafeBrowsingProtocolConfig& config) |
| 96 : client_name_(config.client_name), | 96 : client_name_(config.client_name), |
| 97 request_context_getter_(request_context_getter), | 97 request_context_getter_(request_context_getter), |
| 98 url_prefix_(config.url_prefix) { | 98 url_prefix_(config.url_prefix) { |
| 99 DCHECK(!url_prefix_.empty()); | 99 DCHECK(!url_prefix_.empty()); |
| 100 | 100 |
| 101 if (request_context_getter) { | 101 if (request_context_getter) { |
| 102 net::ReportSender::CookiesPreference cookies_preference; | 102 net::ReportSender::CookiesPreference cookies_preference = |
| 103 GURL certificate_upload_url; | 103 net::ReportSender::DO_NOT_SEND_COOKIES; |
| 104 cookies_preference = net::ReportSender::DO_NOT_SEND_COOKIES; | 104 GURL certificate_upload_url(kExtendedReportingUploadUrlInsecure); |
| 105 certificate_upload_url = GURL(kExtendedReportingUploadUrlInsecure); | |
| 106 | 105 |
| 107 certificate_error_reporter_.reset(new certificate_reporting::ErrorReporter( | 106 certificate_error_reporter_.reset(new certificate_reporting::ErrorReporter( |
| 108 request_context_getter->GetURLRequestContext(), certificate_upload_url, | 107 request_context_getter->GetURLRequestContext(), certificate_upload_url, |
| 109 cookies_preference)); | 108 cookies_preference)); |
| 110 | 109 |
| 111 permission_reporter_.reset( | 110 permission_reporter_.reset( |
| 112 new PermissionReporter(request_context_getter->GetURLRequestContext())); | 111 new PermissionReporter(request_context_getter->GetURLRequestContext())); |
| 113 | 112 |
| 114 net_log_ = net::NetLogWithSource::Make( | 113 net_log_ = net::NetLogWithSource::Make( |
| 115 request_context_getter->GetURLRequestContext()->net_log(), | 114 request_context_getter->GetURLRequestContext()->net_log(), |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 version_.c_str()); | 298 version_.c_str()); |
| 300 std::string api_key = google_apis::GetAPIKey(); | 299 std::string api_key = google_apis::GetAPIKey(); |
| 301 if (!api_key.empty()) { | 300 if (!api_key.empty()) { |
| 302 base::StringAppendF(&url, "&key=%s", | 301 base::StringAppendF(&url, "&key=%s", |
| 303 net::EscapeQueryParamValue(api_key, true).c_str()); | 302 net::EscapeQueryParamValue(api_key, true).c_str()); |
| 304 } | 303 } |
| 305 return GURL(url); | 304 return GURL(url); |
| 306 } | 305 } |
| 307 | 306 |
| 308 } // namespace safe_browsing | 307 } // namespace safe_browsing |
| OLD | NEW |