| 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 27 matching lines...) Expand all Loading... |
| 38 #include "net/proxy/proxy_info.h" | 38 #include "net/proxy/proxy_info.h" |
| 39 #include "net/ssl/ssl_cert_request_info.h" | 39 #include "net/ssl/ssl_cert_request_info.h" |
| 40 #include "net/ssl/ssl_config_service.h" | 40 #include "net/ssl/ssl_config_service.h" |
| 41 #include "net/url_request/fraudulent_certificate_reporter.h" | 41 #include "net/url_request/fraudulent_certificate_reporter.h" |
| 42 #include "net/url_request/http_user_agent_settings.h" | 42 #include "net/url_request/http_user_agent_settings.h" |
| 43 #include "net/url_request/url_request.h" | 43 #include "net/url_request/url_request.h" |
| 44 #include "net/url_request/url_request_context.h" | 44 #include "net/url_request/url_request_context.h" |
| 45 #include "net/url_request/url_request_error_job.h" | 45 #include "net/url_request/url_request_error_job.h" |
| 46 #include "net/url_request/url_request_job_factory.h" | 46 #include "net/url_request/url_request_job_factory.h" |
| 47 #include "net/url_request/url_request_redirect_job.h" | 47 #include "net/url_request/url_request_redirect_job.h" |
| 48 #include "net/url_request/url_request_throttler_header_adapter.h" | |
| 49 #include "net/url_request/url_request_throttler_manager.h" | 48 #include "net/url_request/url_request_throttler_manager.h" |
| 50 #include "net/websockets/websocket_handshake_stream_base.h" | 49 #include "net/websockets/websocket_handshake_stream_base.h" |
| 51 | 50 |
| 52 static const char kAvailDictionaryHeader[] = "Avail-Dictionary"; | 51 static const char kAvailDictionaryHeader[] = "Avail-Dictionary"; |
| 53 | 52 |
| 54 namespace net { | 53 namespace net { |
| 55 | 54 |
| 56 class URLRequestHttpJob::HttpFilterContext : public FilterContext { | 55 class URLRequestHttpJob::HttpFilterContext : public FilterContext { |
| 57 public: | 56 public: |
| 58 explicit HttpFilterContext(URLRequestHttpJob* job); | 57 explicit HttpFilterContext(URLRequestHttpJob* job); |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 | 300 |
| 302 void URLRequestHttpJob::NotifyHeadersComplete() { | 301 void URLRequestHttpJob::NotifyHeadersComplete() { |
| 303 DCHECK(!response_info_); | 302 DCHECK(!response_info_); |
| 304 | 303 |
| 305 response_info_ = transaction_->GetResponseInfo(); | 304 response_info_ = transaction_->GetResponseInfo(); |
| 306 | 305 |
| 307 // Save boolean, as we'll need this info at destruction time, and filters may | 306 // Save boolean, as we'll need this info at destruction time, and filters may |
| 308 // also need this info. | 307 // also need this info. |
| 309 is_cached_content_ = response_info_->was_cached; | 308 is_cached_content_ = response_info_->was_cached; |
| 310 | 309 |
| 311 if (!is_cached_content_ && throttling_entry_.get()) { | 310 if (!is_cached_content_ && throttling_entry_.get()) |
| 312 URLRequestThrottlerHeaderAdapter response_adapter(GetResponseHeaders()); | 311 throttling_entry_->UpdateWithResponse(GetResponseCode()); |
| 313 throttling_entry_->UpdateWithResponse(request_info_.url.host(), | |
| 314 &response_adapter); | |
| 315 } | |
| 316 | 312 |
| 317 // The ordering of these calls is not important. | 313 // The ordering of these calls is not important. |
| 318 ProcessStrictTransportSecurityHeader(); | 314 ProcessStrictTransportSecurityHeader(); |
| 319 ProcessPublicKeyPinsHeader(); | 315 ProcessPublicKeyPinsHeader(); |
| 320 | 316 |
| 321 // Handle the server notification of a new SDCH dictionary. | 317 // Handle the server notification of a new SDCH dictionary. |
| 322 SdchManager* sdch_manager(request()->context()->sdch_manager()); | 318 SdchManager* sdch_manager(request()->context()->sdch_manager()); |
| 323 if (sdch_manager) { | 319 if (sdch_manager) { |
| 324 SdchProblemCode rv = sdch_manager->IsInSupportedDomain(request()->url()); | 320 SdchProblemCode rv = sdch_manager->IsInSupportedDomain(request()->url()); |
| 325 if (rv != SDCH_OK) { | 321 if (rv != SDCH_OK) { |
| (...skipping 1190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1516 return override_response_headers_.get() ? | 1512 return override_response_headers_.get() ? |
| 1517 override_response_headers_.get() : | 1513 override_response_headers_.get() : |
| 1518 transaction_->GetResponseInfo()->headers.get(); | 1514 transaction_->GetResponseInfo()->headers.get(); |
| 1519 } | 1515 } |
| 1520 | 1516 |
| 1521 void URLRequestHttpJob::NotifyURLRequestDestroyed() { | 1517 void URLRequestHttpJob::NotifyURLRequestDestroyed() { |
| 1522 awaiting_callback_ = false; | 1518 awaiting_callback_ = false; |
| 1523 } | 1519 } |
| 1524 | 1520 |
| 1525 } // namespace net | 1521 } // namespace net |
| OLD | NEW |