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 902 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
913 // TODO(mbelshe): The keepalive property is really a property of | 913 // TODO(mbelshe): The keepalive property is really a property of |
914 // the stream. No need to compute it here just to pass back | 914 // the stream. No need to compute it here just to pass back |
915 // to the stream's Close function. | 915 // to the stream's Close function. |
916 if (stream_->CanFindEndOfResponse()) | 916 if (stream_->CanFindEndOfResponse()) |
917 keep_alive = GetResponseHeaders()->IsKeepAlive(); | 917 keep_alive = GetResponseHeaders()->IsKeepAlive(); |
918 } | 918 } |
919 | 919 |
920 // Clean up connection if we are done. | 920 // Clean up connection if we are done. |
921 if (done) { | 921 if (done) { |
922 LogTransactionMetrics(); | 922 LogTransactionMetrics(); |
| 923 stream_->LogNumRttVsBytesMetrics(); |
923 stream_->Close(!keep_alive); | 924 stream_->Close(!keep_alive); |
924 // Note: we don't reset the stream here. We've closed it, but we still | 925 // Note: we don't reset the stream here. We've closed it, but we still |
925 // need it around so that callers can call methods such as | 926 // need it around so that callers can call methods such as |
926 // GetUploadProgress() and have them be meaningful. | 927 // GetUploadProgress() and have them be meaningful. |
927 // TODO(mbelshe): This means we closed the stream here, and we close it | 928 // TODO(mbelshe): This means we closed the stream here, and we close it |
928 // again in ~HttpNetworkTransaction. Clean that up. | 929 // again in ~HttpNetworkTransaction. Clean that up. |
929 | 930 |
930 // The next Read call will return 0 (EOF). | 931 // The next Read call will return 0 (EOF). |
931 } | 932 } |
932 | 933 |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1324 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, | 1325 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, |
1325 state); | 1326 state); |
1326 break; | 1327 break; |
1327 } | 1328 } |
1328 return description; | 1329 return description; |
1329 } | 1330 } |
1330 | 1331 |
1331 #undef STATE_CASE | 1332 #undef STATE_CASE |
1332 | 1333 |
1333 } // namespace net | 1334 } // namespace net |
OLD | NEW |