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 "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 23 matching lines...) Expand all Loading... |
34 #include "net/http/http_request_headers.h" | 34 #include "net/http/http_request_headers.h" |
35 #include "net/http/http_response_headers.h" | 35 #include "net/http/http_response_headers.h" |
36 #include "net/http/http_response_info.h" | 36 #include "net/http/http_response_info.h" |
37 #include "net/http/http_status_code.h" | 37 #include "net/http/http_status_code.h" |
38 #include "net/http/http_transaction.h" | 38 #include "net/http/http_transaction.h" |
39 #include "net/http/http_transaction_factory.h" | 39 #include "net/http/http_transaction_factory.h" |
40 #include "net/http/http_util.h" | 40 #include "net/http/http_util.h" |
41 #include "net/proxy/proxy_info.h" | 41 #include "net/proxy/proxy_info.h" |
42 #include "net/ssl/ssl_cert_request_info.h" | 42 #include "net/ssl/ssl_cert_request_info.h" |
43 #include "net/ssl/ssl_config_service.h" | 43 #include "net/ssl/ssl_config_service.h" |
44 #include "net/url_request/fraudulent_certificate_reporter.h" | |
45 #include "net/url_request/http_user_agent_settings.h" | 44 #include "net/url_request/http_user_agent_settings.h" |
46 #include "net/url_request/url_request.h" | 45 #include "net/url_request/url_request.h" |
47 #include "net/url_request/url_request_backoff_manager.h" | 46 #include "net/url_request/url_request_backoff_manager.h" |
48 #include "net/url_request/url_request_context.h" | 47 #include "net/url_request/url_request_context.h" |
49 #include "net/url_request/url_request_error_job.h" | 48 #include "net/url_request/url_request_error_job.h" |
50 #include "net/url_request/url_request_job_factory.h" | 49 #include "net/url_request/url_request_job_factory.h" |
51 #include "net/url_request/url_request_redirect_job.h" | 50 #include "net/url_request/url_request_redirect_job.h" |
52 #include "net/url_request/url_request_throttler_manager.h" | 51 #include "net/url_request/url_request_throttler_manager.h" |
53 #include "net/websockets/websocket_handshake_stream_base.h" | 52 #include "net/websockets/websocket_handshake_stream_base.h" |
54 | 53 |
(...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
911 if (done_) | 910 if (done_) |
912 return; | 911 return; |
913 | 912 |
914 receive_headers_end_ = base::TimeTicks::Now(); | 913 receive_headers_end_ = base::TimeTicks::Now(); |
915 | 914 |
916 // Clear the IO_PENDING status | 915 // Clear the IO_PENDING status |
917 SetStatus(URLRequestStatus()); | 916 SetStatus(URLRequestStatus()); |
918 | 917 |
919 const URLRequestContext* context = request_->context(); | 918 const URLRequestContext* context = request_->context(); |
920 | 919 |
921 if (result == ERR_SSL_PINNED_KEY_NOT_IN_CERT_CHAIN && | |
922 transaction_->GetResponseInfo() != NULL) { | |
923 FraudulentCertificateReporter* reporter = | |
924 context->fraudulent_certificate_reporter(); | |
925 if (reporter != NULL) { | |
926 const SSLInfo& ssl_info = transaction_->GetResponseInfo()->ssl_info; | |
927 const std::string& host = request_->url().host(); | |
928 | |
929 reporter->SendReport(host, ssl_info); | |
930 } | |
931 } | |
932 | |
933 if (result == OK) { | 920 if (result == OK) { |
934 if (transaction_ && transaction_->GetResponseInfo()) { | 921 if (transaction_ && transaction_->GetResponseInfo()) { |
935 SetProxyServer(transaction_->GetResponseInfo()->proxy_server); | 922 SetProxyServer(transaction_->GetResponseInfo()->proxy_server); |
936 } | 923 } |
937 scoped_refptr<HttpResponseHeaders> headers = GetResponseHeaders(); | 924 scoped_refptr<HttpResponseHeaders> headers = GetResponseHeaders(); |
938 if (network_delegate()) { | 925 if (network_delegate()) { |
939 // Note that |this| may not be deleted until | 926 // Note that |this| may not be deleted until |
940 // |on_headers_received_callback_| or | 927 // |on_headers_received_callback_| or |
941 // |NetworkDelegate::URLRequestDestroyed()| has been called. | 928 // |NetworkDelegate::URLRequestDestroyed()| has been called. |
942 OnCallToDelegate(); | 929 OnCallToDelegate(); |
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1561 return override_response_headers_.get() ? | 1548 return override_response_headers_.get() ? |
1562 override_response_headers_.get() : | 1549 override_response_headers_.get() : |
1563 transaction_->GetResponseInfo()->headers.get(); | 1550 transaction_->GetResponseInfo()->headers.get(); |
1564 } | 1551 } |
1565 | 1552 |
1566 void URLRequestHttpJob::NotifyURLRequestDestroyed() { | 1553 void URLRequestHttpJob::NotifyURLRequestDestroyed() { |
1567 awaiting_callback_ = false; | 1554 awaiting_callback_ = false; |
1568 } | 1555 } |
1569 | 1556 |
1570 } // namespace net | 1557 } // namespace net |
OLD | NEW |