| 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/http/http_network_transaction.h" | 5 #include "net/http/http_network_transaction.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 877 request_headers_.SetHeader(HttpRequestHeaders::kCacheControl, "max-age=0"); | 877 request_headers_.SetHeader(HttpRequestHeaders::kCacheControl, "max-age=0"); |
| 878 } | 878 } |
| 879 | 879 |
| 880 if (ShouldApplyProxyAuth() && HaveAuth(HttpAuth::AUTH_PROXY)) | 880 if (ShouldApplyProxyAuth() && HaveAuth(HttpAuth::AUTH_PROXY)) |
| 881 auth_controllers_[HttpAuth::AUTH_PROXY]->AddAuthorizationHeader( | 881 auth_controllers_[HttpAuth::AUTH_PROXY]->AddAuthorizationHeader( |
| 882 &request_headers_); | 882 &request_headers_); |
| 883 if (ShouldApplyServerAuth() && HaveAuth(HttpAuth::AUTH_SERVER)) | 883 if (ShouldApplyServerAuth() && HaveAuth(HttpAuth::AUTH_SERVER)) |
| 884 auth_controllers_[HttpAuth::AUTH_SERVER]->AddAuthorizationHeader( | 884 auth_controllers_[HttpAuth::AUTH_SERVER]->AddAuthorizationHeader( |
| 885 &request_headers_); | 885 &request_headers_); |
| 886 | 886 |
| 887 request_headers_.MergeFrom(request_->extra_headers); |
| 888 |
| 887 if (using_proxy && !before_proxy_headers_sent_callback_.is_null()) | 889 if (using_proxy && !before_proxy_headers_sent_callback_.is_null()) |
| 888 before_proxy_headers_sent_callback_.Run(proxy_info_); | 890 before_proxy_headers_sent_callback_.Run(proxy_info_, &request_headers_); |
| 889 | 891 |
| 890 request_headers_.MergeFrom(request_->extra_headers); | |
| 891 response_.did_use_http_auth = | 892 response_.did_use_http_auth = |
| 892 request_headers_.HasHeader(HttpRequestHeaders::kAuthorization) || | 893 request_headers_.HasHeader(HttpRequestHeaders::kAuthorization) || |
| 893 request_headers_.HasHeader(HttpRequestHeaders::kProxyAuthorization); | 894 request_headers_.HasHeader(HttpRequestHeaders::kProxyAuthorization); |
| 894 } | 895 } |
| 895 | 896 |
| 896 int HttpNetworkTransaction::DoInitRequestBody() { | 897 int HttpNetworkTransaction::DoInitRequestBody() { |
| 897 next_state_ = STATE_INIT_REQUEST_BODY_COMPLETE; | 898 next_state_ = STATE_INIT_REQUEST_BODY_COMPLETE; |
| 898 int rv = OK; | 899 int rv = OK; |
| 899 if (request_->upload_data_stream) | 900 if (request_->upload_data_stream) |
| 900 rv = request_->upload_data_stream->Init(io_callback_); | 901 rv = request_->upload_data_stream->Init(io_callback_); |
| (...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1559 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, | 1560 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, |
| 1560 state); | 1561 state); |
| 1561 break; | 1562 break; |
| 1562 } | 1563 } |
| 1563 return description; | 1564 return description; |
| 1564 } | 1565 } |
| 1565 | 1566 |
| 1566 #undef STATE_CASE | 1567 #undef STATE_CASE |
| 1567 | 1568 |
| 1568 } // namespace net | 1569 } // namespace net |
| OLD | NEW |