| 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/socket/client_socket_pool_base.h" | 5 #include "net/socket/client_socket_pool_base.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1033 handle->set_connect_timing(connect_timing); | 1033 handle->set_connect_timing(connect_timing); |
| 1034 | 1034 |
| 1035 if (reuse_type == ClientSocketHandle::REUSED_IDLE) { | 1035 if (reuse_type == ClientSocketHandle::REUSED_IDLE) { |
| 1036 net_log.AddEvent( | 1036 net_log.AddEvent( |
| 1037 NetLogEventType::SOCKET_POOL_REUSED_AN_EXISTING_SOCKET, | 1037 NetLogEventType::SOCKET_POOL_REUSED_AN_EXISTING_SOCKET, |
| 1038 NetLog::IntCallback("idle_ms", | 1038 NetLog::IntCallback("idle_ms", |
| 1039 static_cast<int>(idle_time.InMilliseconds()))); | 1039 static_cast<int>(idle_time.InMilliseconds()))); |
| 1040 | 1040 |
| 1041 UMA_HISTOGRAM_COUNTS_1000("Net.Socket.IdleSocketReuseTime", | 1041 UMA_HISTOGRAM_COUNTS_1000("Net.Socket.IdleSocketReuseTime", |
| 1042 idle_time.InSeconds()); | 1042 idle_time.InSeconds()); |
| 1043 UMA_HISTOGRAM_TIMES( | |
| 1044 "Net.Socket.IdleSocketTimeSaving", | |
| 1045 connect_timing.connect_end - connect_timing.connect_start); | |
| 1046 } | 1043 } |
| 1047 | 1044 |
| 1048 if (reuse_type != ClientSocketHandle::UNUSED) { | 1045 if (reuse_type != ClientSocketHandle::UNUSED) { |
| 1049 // The socket being handed out is no longer considered idle, but was | 1046 // The socket being handed out is no longer considered idle, but was |
| 1050 // considered idle until just before this method was called. | 1047 // considered idle until just before this method was called. |
| 1051 UMA_HISTOGRAM_CUSTOM_COUNTS("Net.Socket.NumIdleSockets", | 1048 UMA_HISTOGRAM_CUSTOM_COUNTS("Net.Socket.NumIdleSockets", |
| 1052 idle_socket_count() + 1, 1, 256, 50); | 1049 idle_socket_count() + 1, 1, 256, 50); |
| 1053 } | 1050 } |
| 1054 | 1051 |
| 1055 net_log.AddEvent( | 1052 net_log.AddEvent( |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1384 // If there are no more requests, kill the backup timer. | 1381 // If there are no more requests, kill the backup timer. |
| 1385 if (pending_requests_.empty()) | 1382 if (pending_requests_.empty()) |
| 1386 backup_job_timer_.Stop(); | 1383 backup_job_timer_.Stop(); |
| 1387 request->CrashIfInvalid(); | 1384 request->CrashIfInvalid(); |
| 1388 return request; | 1385 return request; |
| 1389 } | 1386 } |
| 1390 | 1387 |
| 1391 } // namespace internal | 1388 } // namespace internal |
| 1392 | 1389 |
| 1393 } // namespace net | 1390 } // namespace net |
| OLD | NEW |