Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(257)

Side by Side Diff: net/url_request/url_request_http_job.cc

Issue 12974003: Improve TransportSecurityState data storage. (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/url_request/fraudulent_certificate_reporter.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "net/url_request/url_request_http_job.h" 5 #include "net/url_request/url_request_http_job.h"
6 6
7 #include "base/base_switches.h" 7 #include "base/base_switches.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after
745 SetStatus(URLRequestStatus()); 745 SetStatus(URLRequestStatus());
746 746
747 const URLRequestContext* context = request_->context(); 747 const URLRequestContext* context = request_->context();
748 748
749 if (result == ERR_SSL_PINNED_KEY_NOT_IN_CERT_CHAIN && 749 if (result == ERR_SSL_PINNED_KEY_NOT_IN_CERT_CHAIN &&
750 transaction_->GetResponseInfo() != NULL) { 750 transaction_->GetResponseInfo() != NULL) {
751 FraudulentCertificateReporter* reporter = 751 FraudulentCertificateReporter* reporter =
752 context->fraudulent_certificate_reporter(); 752 context->fraudulent_certificate_reporter();
753 if (reporter != NULL) { 753 if (reporter != NULL) {
754 const SSLInfo& ssl_info = transaction_->GetResponseInfo()->ssl_info; 754 const SSLInfo& ssl_info = transaction_->GetResponseInfo()->ssl_info;
755 bool sni_available = SSLConfigService::IsSNIAvailable(
756 context->ssl_config_service());
757 const std::string& host = request_->url().host(); 755 const std::string& host = request_->url().host();
758 756
759 reporter->SendReport(host, ssl_info, sni_available); 757 TransportSecurityState::DomainState domain_state;
758 const URLRequestContext* context = request_->context();
759 const bool report_to_google =
760 context->transport_security_state() &&
761 context->transport_security_state()->GetDomainState(
762 host,
763 SSLConfigService::IsSNIAvailable(context->ssl_config_service()),
764 &domain_state) &&
765 domain_state.IsGooglePinnedProperty();
766 if (report_to_google)
767 reporter->SendReport(host, ssl_info);
760 } 768 }
761 } 769 }
762 770
763 if (result == OK) { 771 if (result == OK) {
764 scoped_refptr<HttpResponseHeaders> headers = GetResponseHeaders(); 772 scoped_refptr<HttpResponseHeaders> headers = GetResponseHeaders();
765 if (context->network_delegate()) { 773 if (context->network_delegate()) {
766 // Note that |this| may not be deleted until 774 // Note that |this| may not be deleted until
767 // |on_headers_received_callback_| or 775 // |on_headers_received_callback_| or
768 // |NetworkDelegate::URLRequestDestroyed()| has been called. 776 // |NetworkDelegate::URLRequestDestroyed()| has been called.
769 int error = context->network_delegate()-> 777 int error = context->network_delegate()->
(...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after
1574 1582
1575 void URLRequestHttpJob::NotifyURLRequestDestroyed() { 1583 void URLRequestHttpJob::NotifyURLRequestDestroyed() {
1576 awaiting_callback_ = false; 1584 awaiting_callback_ = false;
1577 } 1585 }
1578 1586
1579 void URLRequestHttpJob::OnDetachRequest() { 1587 void URLRequestHttpJob::OnDetachRequest() {
1580 http_transaction_delegate_->OnDetachRequest(); 1588 http_transaction_delegate_->OnDetachRequest();
1581 } 1589 }
1582 1590
1583 } // namespace net 1591 } // namespace net
OLDNEW
« no previous file with comments | « net/url_request/fraudulent_certificate_reporter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698