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

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

Issue 13609002: fix a problem that android cannot download files with basic authentication (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: adding a call in http_transactions to get the auth info Created 7 years, 8 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) 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 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 309
310 // Reset the other member variables. 310 // Reset the other member variables.
311 ResetStateForAuthRestart(); 311 ResetStateForAuthRestart();
312 } 312 }
313 313
314 bool HttpNetworkTransaction::IsReadyToRestartForAuth() { 314 bool HttpNetworkTransaction::IsReadyToRestartForAuth() {
315 return pending_auth_target_ != HttpAuth::AUTH_NONE && 315 return pending_auth_target_ != HttpAuth::AUTH_NONE &&
316 HaveAuth(pending_auth_target_); 316 HaveAuth(pending_auth_target_);
317 } 317 }
318 318
319 bool HttpNetworkTransaction::HasAuth() const {
320 return request_headers_.HasHeader(HttpRequestHeaders::kProxyAuthorization) ||
321 request_headers_.HasHeader(HttpRequestHeaders::kAuthorization);
322 }
323
319 int HttpNetworkTransaction::Read(IOBuffer* buf, int buf_len, 324 int HttpNetworkTransaction::Read(IOBuffer* buf, int buf_len,
320 const CompletionCallback& callback) { 325 const CompletionCallback& callback) {
321 DCHECK(buf); 326 DCHECK(buf);
322 DCHECK_LT(0, buf_len); 327 DCHECK_LT(0, buf_len);
323 328
324 State next_state = STATE_NONE; 329 State next_state = STATE_NONE;
325 330
326 scoped_refptr<HttpResponseHeaders> headers(GetResponseHeaders()); 331 scoped_refptr<HttpResponseHeaders> headers(GetResponseHeaders());
327 if (headers_valid_ && headers.get() && stream_request_.get()) { 332 if (headers_valid_ && headers.get() && stream_request_.get()) {
328 // We're trying to read the body of the response but we're still trying 333 // We're trying to read the body of the response but we're still trying
(...skipping 1132 matching lines...) Expand 10 before | Expand all | Expand 10 after
1461 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, 1466 description = base::StringPrintf("Unknown state 0x%08X (%u)", state,
1462 state); 1467 state);
1463 break; 1468 break;
1464 } 1469 }
1465 return description; 1470 return description;
1466 } 1471 }
1467 1472
1468 #undef STATE_CASE 1473 #undef STATE_CASE
1469 1474
1470 } // namespace net 1475 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698