| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 DCHECK(user_callback_); | 472 DCHECK(user_callback_); |
| 473 | 473 |
| 474 // Since Run may result in Read being called, clear user_callback_ up front. | 474 // Since Run may result in Read being called, clear user_callback_ up front. |
| 475 CompletionCallback* c = user_callback_; | 475 CompletionCallback* c = user_callback_; |
| 476 user_callback_ = NULL; | 476 user_callback_ = NULL; |
| 477 c->Run(rv); | 477 c->Run(rv); |
| 478 } | 478 } |
| 479 | 479 |
| 480 void HttpNetworkTransaction::OnIOComplete(int result) { | 480 void HttpNetworkTransaction::OnIOComplete(int result) { |
| 481 int rv = DoLoop(result); | 481 int rv = DoLoop(result); |
| 482 if (rv == ERR_PIPELINE_EVICTION) { |
| 483 stream_.reset(); |
| 484 stream_request_.reset(); |
| 485 next_state_ = STATE_NONE; |
| 486 RestartIgnoringLastError(user_callback_); |
| 487 } |
| 482 if (rv != ERR_IO_PENDING) | 488 if (rv != ERR_IO_PENDING) |
| 483 DoCallback(rv); | 489 DoCallback(rv); |
| 484 } | 490 } |
| 485 | 491 |
| 486 int HttpNetworkTransaction::DoLoop(int result) { | 492 int HttpNetworkTransaction::DoLoop(int result) { |
| 487 DCHECK(next_state_ != STATE_NONE); | 493 DCHECK(next_state_ != STATE_NONE); |
| 488 | 494 |
| 489 int rv = result; | 495 int rv = result; |
| 490 do { | 496 do { |
| 491 State state = next_state_; | 497 State state = next_state_; |
| (...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1309 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, | 1315 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, |
| 1310 state); | 1316 state); |
| 1311 break; | 1317 break; |
| 1312 } | 1318 } |
| 1313 return description; | 1319 return description; |
| 1314 } | 1320 } |
| 1315 | 1321 |
| 1316 #undef STATE_CASE | 1322 #undef STATE_CASE |
| 1317 | 1323 |
| 1318 } // namespace net | 1324 } // namespace net |
| OLD | NEW |