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

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

Issue 3107036: Fix a crash where we are checking IsConnected(). If you look into the ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: nits, extra EXPECTS() in test cases added Created 10 years, 4 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 | Annotate | Revision Log
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_proxy_client_socket.h" 5 #include "net/http/http_proxy_client_socket.h"
6 6
7 #include "base/string_util.h" 7 #include "base/string_util.h"
8 #include "googleurl/src/gurl.h" 8 #include "googleurl/src/gurl.h"
9 #include "net/base/auth.h" 9 #include "net/base/auth.h"
10 #include "net/base/host_port_pair.h" 10 #include "net/base/host_port_pair.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 user_agent); 74 user_agent);
75 } 75 }
76 76
77 HttpProxyClientSocket::~HttpProxyClientSocket() { 77 HttpProxyClientSocket::~HttpProxyClientSocket() {
78 Disconnect(); 78 Disconnect();
79 } 79 }
80 80
81 int HttpProxyClientSocket::Connect(CompletionCallback* callback) { 81 int HttpProxyClientSocket::Connect(CompletionCallback* callback) {
82 DCHECK(transport_.get()); 82 DCHECK(transport_.get());
83 DCHECK(transport_->socket()); 83 DCHECK(transport_->socket());
84 DCHECK(transport_->socket()->IsConnected());
85 DCHECK(!user_callback_); 84 DCHECK(!user_callback_);
86 85
87 if (!tunnel_) 86 if (!tunnel_)
88 next_state_ = STATE_DONE; 87 next_state_ = STATE_DONE;
89 if (next_state_ == STATE_DONE) 88 if (next_state_ == STATE_DONE)
90 return OK; 89 return OK;
91 90
92 DCHECK_EQ(STATE_NONE, next_state_); 91 DCHECK_EQ(STATE_NONE, next_state_);
93 next_state_ = STATE_GENERATE_AUTH_TOKEN; 92 next_state_ = STATE_GENERATE_AUTH_TOKEN;
94 93
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 435
437 int rv = auth_->HandleAuthChallenge(response_.headers, false, true, net_log_); 436 int rv = auth_->HandleAuthChallenge(response_.headers, false, true, net_log_);
438 response_.auth_challenge = auth_->auth_info(); 437 response_.auth_challenge = auth_->auth_info();
439 if (rv == OK) 438 if (rv == OK)
440 return ERR_PROXY_AUTH_REQUESTED; 439 return ERR_PROXY_AUTH_REQUESTED;
441 440
442 return rv; 441 return rv;
443 } 442 }
444 443
445 } // namespace net 444 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698