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(); |
943 stream_->Close(!keep_alive); | 944 stream_->Close(!keep_alive); |
944 // Note: we don't reset the stream here. We've closed it, but we still | 945 // Note: we don't reset the stream here. We've closed it, but we still |
945 // need it around so that callers can call methods such as | 946 // need it around so that callers can call methods such as |
946 // GetUploadProgress() and have them be meaningful. | 947 // GetUploadProgress() and have them be meaningful. |
947 // TODO(mbelshe): This means we closed the stream here, and we close it | 948 // TODO(mbelshe): This means we closed the stream here, and we close it |
948 // again in ~HttpNetworkTransaction. Clean that up. | 949 // again in ~HttpNetworkTransaction. Clean that up. |
949 | 950 |
950 // The next Read call will return 0 (EOF). | 951 // The next Read call will return 0 (EOF). |
951 } | 952 } |
952 | 953 |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1344 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, | 1345 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, |
1345 state); | 1346 state); |
1346 break; | 1347 break; |
1347 } | 1348 } |
1348 return description; | 1349 return description; |
1349 } | 1350 } |
1350 | 1351 |
1351 #undef STATE_CASE | 1352 #undef STATE_CASE |
1352 | 1353 |
1353 } // namespace net | 1354 } // namespace net |
OLD | NEW |