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

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

Issue 2806052: Remove the net_log member from HttpAuthController. (Closed)
Patch Set: Created 10 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/field_trial.h" 8 #include "base/field_trial.h"
9 #include "base/format_macros.h" 9 #include "base/format_macros.h"
10 #include "base/histogram.h" 10 #include "base/histogram.h"
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after
701 int HttpNetworkTransaction::DoInitConnection() { 701 int HttpNetworkTransaction::DoInitConnection() {
702 DCHECK(!connection_->is_initialized()); 702 DCHECK(!connection_->is_initialized());
703 DCHECK(proxy_info_.proxy_server().is_valid()); 703 DCHECK(proxy_info_.proxy_server().is_valid());
704 704
705 // Now that the proxy server has been resolved, create the auth_controllers_. 705 // Now that the proxy server has been resolved, create the auth_controllers_.
706 for (int i = 0; i < HttpAuth::AUTH_NUM_TARGETS; i++) { 706 for (int i = 0; i < HttpAuth::AUTH_NUM_TARGETS; i++) {
707 HttpAuth::Target target = static_cast<HttpAuth::Target>(i); 707 HttpAuth::Target target = static_cast<HttpAuth::Target>(i);
708 if (!auth_controllers_[target].get()) 708 if (!auth_controllers_[target].get())
709 auth_controllers_[target] = new HttpAuthController(target, 709 auth_controllers_[target] = new HttpAuthController(target,
710 AuthURL(target), 710 AuthURL(target),
711 session_, net_log_); 711 session_);
712 } 712 }
713 713
714 next_state_ = STATE_INIT_CONNECTION_COMPLETE; 714 next_state_ = STATE_INIT_CONNECTION_COMPLETE;
715 715
716 using_ssl_ = request_->url.SchemeIs("https") || 716 using_ssl_ = request_->url.SchemeIs("https") ||
717 (alternate_protocol_mode_ == kUsingAlternateProtocol && 717 (alternate_protocol_mode_ == kUsingAlternateProtocol &&
718 alternate_protocol_ == HttpAlternateProtocols::NPN_SPDY_1); 718 alternate_protocol_ == HttpAlternateProtocols::NPN_SPDY_1);
719 719
720 using_spdy_ = false; 720 using_spdy_ = false;
721 721
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
994 result = HandleSSLHandshakeError(result); 994 result = HandleSSLHandshakeError(result);
995 } 995 }
996 return result; 996 return result;
997 } 997 }
998 998
999 int HttpNetworkTransaction::DoGenerateProxyAuthToken() { 999 int HttpNetworkTransaction::DoGenerateProxyAuthToken() {
1000 next_state_ = STATE_GENERATE_PROXY_AUTH_TOKEN_COMPLETE; 1000 next_state_ = STATE_GENERATE_PROXY_AUTH_TOKEN_COMPLETE;
1001 if (!ShouldApplyProxyAuth()) 1001 if (!ShouldApplyProxyAuth())
1002 return OK; 1002 return OK;
1003 return auth_controllers_[HttpAuth::AUTH_PROXY]->MaybeGenerateAuthToken( 1003 return auth_controllers_[HttpAuth::AUTH_PROXY]->MaybeGenerateAuthToken(
1004 request_, &io_callback_); 1004 request_, &io_callback_, net_log_);
1005 } 1005 }
1006 1006
1007 int HttpNetworkTransaction::DoGenerateProxyAuthTokenComplete(int rv) { 1007 int HttpNetworkTransaction::DoGenerateProxyAuthTokenComplete(int rv) {
1008 DCHECK_NE(ERR_IO_PENDING, rv); 1008 DCHECK_NE(ERR_IO_PENDING, rv);
1009 if (rv == OK) 1009 if (rv == OK)
1010 next_state_ = STATE_GENERATE_SERVER_AUTH_TOKEN; 1010 next_state_ = STATE_GENERATE_SERVER_AUTH_TOKEN;
1011 return rv; 1011 return rv;
1012 } 1012 }
1013 1013
1014 int HttpNetworkTransaction::DoGenerateServerAuthToken() { 1014 int HttpNetworkTransaction::DoGenerateServerAuthToken() {
1015 next_state_ = STATE_GENERATE_SERVER_AUTH_TOKEN_COMPLETE; 1015 next_state_ = STATE_GENERATE_SERVER_AUTH_TOKEN_COMPLETE;
1016 if (!ShouldApplyServerAuth()) 1016 if (!ShouldApplyServerAuth())
1017 return OK; 1017 return OK;
1018 return auth_controllers_[HttpAuth::AUTH_SERVER]->MaybeGenerateAuthToken( 1018 return auth_controllers_[HttpAuth::AUTH_SERVER]->MaybeGenerateAuthToken(
1019 request_, &io_callback_); 1019 request_, &io_callback_, net_log_);
1020 } 1020 }
1021 1021
1022 int HttpNetworkTransaction::DoGenerateServerAuthTokenComplete(int rv) { 1022 int HttpNetworkTransaction::DoGenerateServerAuthTokenComplete(int rv) {
1023 DCHECK_NE(ERR_IO_PENDING, rv); 1023 DCHECK_NE(ERR_IO_PENDING, rv);
1024 if (rv == OK) 1024 if (rv == OK)
1025 next_state_ = STATE_SEND_REQUEST; 1025 next_state_ = STATE_SEND_REQUEST;
1026 return rv; 1026 return rv;
1027 } 1027 }
1028 1028
1029 int HttpNetworkTransaction::DoSendRequest() { 1029 int HttpNetworkTransaction::DoSendRequest() {
(...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after
1772 1772
1773 int status = headers->response_code(); 1773 int status = headers->response_code();
1774 if (status != 401 && status != 407) 1774 if (status != 401 && status != 407)
1775 return OK; 1775 return OK;
1776 HttpAuth::Target target = status == 407 ? 1776 HttpAuth::Target target = status == 407 ?
1777 HttpAuth::AUTH_PROXY : HttpAuth::AUTH_SERVER; 1777 HttpAuth::AUTH_PROXY : HttpAuth::AUTH_SERVER;
1778 if (target == HttpAuth::AUTH_PROXY && proxy_info_.is_direct()) 1778 if (target == HttpAuth::AUTH_PROXY && proxy_info_.is_direct())
1779 return ERR_UNEXPECTED_PROXY_AUTH; 1779 return ERR_UNEXPECTED_PROXY_AUTH;
1780 1780
1781 int rv = auth_controllers_[target]->HandleAuthChallenge( 1781 int rv = auth_controllers_[target]->HandleAuthChallenge(
1782 headers, (request_->load_flags & LOAD_DO_NOT_SEND_AUTH_DATA) != 0, false); 1782 headers, (request_->load_flags & LOAD_DO_NOT_SEND_AUTH_DATA) != 0, false,
1783 net_log_);
1783 if (auth_controllers_[target]->HaveAuthHandler()) 1784 if (auth_controllers_[target]->HaveAuthHandler())
1784 pending_auth_target_ = target; 1785 pending_auth_target_ = target;
1785 1786
1786 scoped_refptr<AuthChallengeInfo> auth_info = 1787 scoped_refptr<AuthChallengeInfo> auth_info =
1787 auth_controllers_[target]->auth_info(); 1788 auth_controllers_[target]->auth_info();
1788 if (auth_info.get()) 1789 if (auth_info.get())
1789 response_.auth_challenge = auth_info; 1790 response_.auth_challenge = auth_info;
1790 1791
1791 return rv; 1792 return rv;
1792 } 1793 }
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
1863 default: 1864 default:
1864 description = StringPrintf("Unknown state 0x%08X (%u)", state, state); 1865 description = StringPrintf("Unknown state 0x%08X (%u)", state, state);
1865 break; 1866 break;
1866 } 1867 }
1867 return description; 1868 return description;
1868 } 1869 }
1869 1870
1870 #undef STATE_CASE 1871 #undef STATE_CASE
1871 1872
1872 } // namespace net 1873 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698