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 922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
933 // TODO(mbelshe): The keepalive property is really a property of | 933 // TODO(mbelshe): The keepalive property is really a property of |
934 // the stream. No need to compute it here just to pass back | 934 // the stream. No need to compute it here just to pass back |
935 // to the stream's Close function. | 935 // to the stream's Close function. |
936 if (stream_->CanFindEndOfResponse()) | 936 if (stream_->CanFindEndOfResponse()) |
937 keep_alive = GetResponseHeaders()->IsKeepAlive(); | 937 keep_alive = GetResponseHeaders()->IsKeepAlive(); |
938 } | 938 } |
939 | 939 |
940 // Clean up connection if we are done. | 940 // Clean up connection if we are done. |
941 if (done) { | 941 if (done) { |
942 LogTransactionMetrics(); | 942 LogTransactionMetrics(); |
943 stream_->LogNumRttVsBytesMetrics(); | |
944 stream_->Close(!keep_alive); | 943 stream_->Close(!keep_alive); |
945 // Note: we don't reset the stream here. We've closed it, but we still | 944 // Note: we don't reset the stream here. We've closed it, but we still |
946 // need it around so that callers can call methods such as | 945 // need it around so that callers can call methods such as |
947 // GetUploadProgress() and have them be meaningful. | 946 // GetUploadProgress() and have them be meaningful. |
948 // TODO(mbelshe): This means we closed the stream here, and we close it | 947 // TODO(mbelshe): This means we closed the stream here, and we close it |
949 // again in ~HttpNetworkTransaction. Clean that up. | 948 // again in ~HttpNetworkTransaction. Clean that up. |
950 | 949 |
951 // The next Read call will return 0 (EOF). | 950 // The next Read call will return 0 (EOF). |
952 } | 951 } |
953 | 952 |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1345 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, | 1344 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, |
1346 state); | 1345 state); |
1347 break; | 1346 break; |
1348 } | 1347 } |
1349 return description; | 1348 return description; |
1350 } | 1349 } |
1351 | 1350 |
1352 #undef STATE_CASE | 1351 #undef STATE_CASE |
1353 | 1352 |
1354 } // namespace net | 1353 } // namespace net |
OLD | NEW |