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

Side by Side Diff: net/http/http_network_transaction.cc

Issue 360113004: Add header pointer to BeforeProxyHeadersSentCallback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comment Created 6 years, 5 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 | « no previous file | net/http/http_network_transaction_unittest.cc » ('j') | 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/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
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
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
OLDNEW
« no previous file with comments | « no previous file | net/http/http_network_transaction_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698