Chromium Code Reviews| 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/net/chrome_fraudulent_certificate_reporter.h" | 5 #include "chrome/browser/net/chrome_fraudulent_certificate_reporter.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 58 net::URLRequest* ChromeFraudulentCertificateReporter::CreateURLRequest( | 58 net::URLRequest* ChromeFraudulentCertificateReporter::CreateURLRequest( |
| 59 net::URLRequestContext* context) { | 59 net::URLRequestContext* context) { |
| 60 net::URLRequest* request = context->CreateRequest(upload_url_, this); | 60 net::URLRequest* request = context->CreateRequest(upload_url_, this); |
| 61 request->set_load_flags(net::LOAD_DO_NOT_SEND_COOKIES | | 61 request->set_load_flags(net::LOAD_DO_NOT_SEND_COOKIES | |
| 62 net::LOAD_DO_NOT_SAVE_COOKIES); | 62 net::LOAD_DO_NOT_SAVE_COOKIES); |
| 63 return request; | 63 return request; |
| 64 } | 64 } |
| 65 | 65 |
| 66 void ChromeFraudulentCertificateReporter::SendReport( | 66 void ChromeFraudulentCertificateReporter::SendReport( |
| 67 const std::string& hostname, | 67 const std::string& hostname, |
| 68 const net::SSLInfo& ssl_info, | 68 const net::SSLInfo& ssl_info) { |
| 69 bool sni_available) { | |
| 70 // We do silent/automatic reporting ONLY for Google properties. For other | 69 // We do silent/automatic reporting ONLY for Google properties. For other |
| 71 // domains (when we start supporting that), we will ask for user permission. | 70 // domains (when we start supporting that), we will ask for user permission. |
|
palmer
2013/03/25 23:54:34
So what code now enforces this comment?
I think w
unsafe
2013/03/26 01:42:22
URLRequestHttpJob::OnStartCompleted().
| |
| 72 if (!net::TransportSecurityState::IsGooglePinnedProperty(hostname, | |
| 73 sni_available)) { | |
| 74 return; | |
| 75 } | |
| 76 | 71 |
| 77 std::string report = BuildReport(hostname, ssl_info); | 72 std::string report = BuildReport(hostname, ssl_info); |
| 78 | 73 |
| 79 net::URLRequest* url_request = CreateURLRequest(request_context_); | 74 net::URLRequest* url_request = CreateURLRequest(request_context_); |
| 80 url_request->set_method("POST"); | 75 url_request->set_method("POST"); |
| 81 | 76 |
| 82 scoped_ptr<net::UploadElementReader> reader( | 77 scoped_ptr<net::UploadElementReader> reader( |
| 83 net::UploadOwnedBytesElementReader::CreateWithString(report)); | 78 net::UploadOwnedBytesElementReader::CreateWithString(report)); |
| 84 url_request->set_upload(make_scoped_ptr( | 79 url_request->set_upload(make_scoped_ptr( |
| 85 net::UploadDataStream::CreateWithReader(reader.Pass(), 0))); | 80 net::UploadDataStream::CreateWithReader(reader.Pass(), 0))); |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 115 LOG(WARNING) << "Certificate upload HTTP status: " | 110 LOG(WARNING) << "Certificate upload HTTP status: " |
| 116 << request->GetResponseCode(); | 111 << request->GetResponseCode(); |
| 117 } | 112 } |
| 118 RequestComplete(request); | 113 RequestComplete(request); |
| 119 } | 114 } |
| 120 | 115 |
| 121 void ChromeFraudulentCertificateReporter::OnReadCompleted( | 116 void ChromeFraudulentCertificateReporter::OnReadCompleted( |
| 122 net::URLRequest* request, int bytes_read) {} | 117 net::URLRequest* request, int bytes_read) {} |
| 123 | 118 |
| 124 } // namespace chrome_browser_net | 119 } // namespace chrome_browser_net |
| OLD | NEW |