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

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, 8 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
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 = context->transport_security_state() &&
760 context->transport_security_state()->GetDomainState(host,
761 SSLConfigService::IsSNIAvailable(context->ssl_config_service()),
762 &domain_state) && domain_state.IsGooglePinnedProperty();
Ryan Sleevi 2013/04/29 22:06:14 style nit: The wrapping here is... a bit unreadabl
unsafe 2013/04/30 10:42:57 Done.
763 if (report_to_google)
764 reporter->SendReport(host, ssl_info);
760 } 765 }
761 } 766 }
762 767
763 if (result == OK) { 768 if (result == OK) {
764 scoped_refptr<HttpResponseHeaders> headers = GetResponseHeaders(); 769 scoped_refptr<HttpResponseHeaders> headers = GetResponseHeaders();
765 if (context->network_delegate()) { 770 if (context->network_delegate()) {
766 // Note that |this| may not be deleted until 771 // Note that |this| may not be deleted until
767 // |on_headers_received_callback_| or 772 // |on_headers_received_callback_| or
768 // |NetworkDelegate::URLRequestDestroyed()| has been called. 773 // |NetworkDelegate::URLRequestDestroyed()| has been called.
769 int error = context->network_delegate()-> 774 int error = context->network_delegate()->
(...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after
1574 1579
1575 void URLRequestHttpJob::NotifyURLRequestDestroyed() { 1580 void URLRequestHttpJob::NotifyURLRequestDestroyed() {
1576 awaiting_callback_ = false; 1581 awaiting_callback_ = false;
1577 } 1582 }
1578 1583
1579 void URLRequestHttpJob::OnDetachRequest() { 1584 void URLRequestHttpJob::OnDetachRequest() {
1580 http_transaction_delegate_->OnDetachRequest(); 1585 http_transaction_delegate_->OnDetachRequest();
1581 } 1586 }
1582 1587
1583 } // namespace net 1588 } // namespace net
OLDNEW
« net/base/transport_security_state.cc ('K') | « 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