OLD | NEW |
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 972 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
983 if (stream_->CanFindEndOfResponse()) { | 983 if (stream_->CanFindEndOfResponse()) { |
984 HttpResponseHeaders* headers = GetResponseHeaders(); | 984 HttpResponseHeaders* headers = GetResponseHeaders(); |
985 if (headers) | 985 if (headers) |
986 keep_alive = headers->IsKeepAlive(); | 986 keep_alive = headers->IsKeepAlive(); |
987 } | 987 } |
988 } | 988 } |
989 | 989 |
990 // Clean up connection if we are done. | 990 // Clean up connection if we are done. |
991 if (done) { | 991 if (done) { |
992 LogTransactionMetrics(); | 992 LogTransactionMetrics(); |
993 // TODO(bashi): This cast is temporary. Remove later. | |
994 static_cast<HttpStream*>(stream_.get())->LogNumRttVsBytesMetrics(); | |
995 stream_->Close(!keep_alive); | 993 stream_->Close(!keep_alive); |
996 // Note: we don't reset the stream here. We've closed it, but we still | 994 // Note: we don't reset the stream here. We've closed it, but we still |
997 // need it around so that callers can call methods such as | 995 // need it around so that callers can call methods such as |
998 // GetUploadProgress() and have them be meaningful. | 996 // GetUploadProgress() and have them be meaningful. |
999 // TODO(mbelshe): This means we closed the stream here, and we close it | 997 // TODO(mbelshe): This means we closed the stream here, and we close it |
1000 // again in ~HttpNetworkTransaction. Clean that up. | 998 // again in ~HttpNetworkTransaction. Clean that up. |
1001 | 999 |
1002 // The next Read call will return 0 (EOF). | 1000 // The next Read call will return 0 (EOF). |
1003 } | 1001 } |
1004 | 1002 |
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1463 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, | 1461 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, |
1464 state); | 1462 state); |
1465 break; | 1463 break; |
1466 } | 1464 } |
1467 return description; | 1465 return description; |
1468 } | 1466 } |
1469 | 1467 |
1470 #undef STATE_CASE | 1468 #undef STATE_CASE |
1471 | 1469 |
1472 } // namespace net | 1470 } // namespace net |
OLD | NEW |