| 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_handle.h" | 5 #include "net/socket/client_socket_handle.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 } | 59 } |
| 60 is_initialized_ = false; | 60 is_initialized_ = false; |
| 61 socket_.reset(); | 61 socket_.reset(); |
| 62 group_name_.clear(); | 62 group_name_.clear(); |
| 63 reuse_type_ = ClientSocketHandle::UNUSED; | 63 reuse_type_ = ClientSocketHandle::UNUSED; |
| 64 user_callback_.Reset(); | 64 user_callback_.Reset(); |
| 65 if (higher_pool_) | 65 if (higher_pool_) |
| 66 RemoveHigherLayeredPool(higher_pool_); | 66 RemoveHigherLayeredPool(higher_pool_); |
| 67 pool_ = NULL; | 67 pool_ = NULL; |
| 68 idle_time_ = base::TimeDelta(); | 68 idle_time_ = base::TimeDelta(); |
| 69 init_time_ = base::TimeTicks(); | |
| 70 setup_time_ = base::TimeDelta(); | |
| 71 connect_timing_ = LoadTimingInfo::ConnectTiming(); | 69 connect_timing_ = LoadTimingInfo::ConnectTiming(); |
| 72 pool_id_ = -1; | 70 pool_id_ = -1; |
| 73 } | 71 } |
| 74 | 72 |
| 75 void ClientSocketHandle::ResetErrorState() { | 73 void ClientSocketHandle::ResetErrorState() { |
| 76 is_ssl_error_ = false; | 74 is_ssl_error_ = false; |
| 77 ssl_error_response_info_ = HttpResponseInfo(); | 75 ssl_error_response_info_ = HttpResponseInfo(); |
| 78 pending_http_proxy_connection_.reset(); | 76 pending_http_proxy_connection_.reset(); |
| 79 } | 77 } |
| 80 | 78 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 CHECK_NE(ERR_IO_PENDING, result); | 152 CHECK_NE(ERR_IO_PENDING, result); |
| 155 if (result != OK) { | 153 if (result != OK) { |
| 156 if (!socket_.get()) | 154 if (!socket_.get()) |
| 157 ResetInternal(false); // Nothing to cancel since the request failed. | 155 ResetInternal(false); // Nothing to cancel since the request failed. |
| 158 else | 156 else |
| 159 is_initialized_ = true; | 157 is_initialized_ = true; |
| 160 return; | 158 return; |
| 161 } | 159 } |
| 162 is_initialized_ = true; | 160 is_initialized_ = true; |
| 163 CHECK_NE(-1, pool_id_) << "Pool should have set |pool_id_| to a valid value."; | 161 CHECK_NE(-1, pool_id_) << "Pool should have set |pool_id_| to a valid value."; |
| 164 setup_time_ = base::TimeTicks::Now() - init_time_; | |
| 165 | 162 |
| 166 // Broadcast that the socket has been acquired. | 163 // Broadcast that the socket has been acquired. |
| 167 // TODO(eroman): This logging is not complete, in particular set_socket() and | 164 // TODO(eroman): This logging is not complete, in particular set_socket() and |
| 168 // release() socket. It ends up working though, since those methods are being | 165 // release() socket. It ends up working though, since those methods are being |
| 169 // used to layer sockets (and the destination sources are the same). | 166 // used to layer sockets (and the destination sources are the same). |
| 170 DCHECK(socket_.get()); | 167 DCHECK(socket_.get()); |
| 171 socket_->NetLog().BeginEvent(NetLogEventType::SOCKET_IN_USE, | 168 socket_->NetLog().BeginEvent(NetLogEventType::SOCKET_IN_USE, |
| 172 requesting_source_.ToEventParametersCallback()); | 169 requesting_source_.ToEventParametersCallback()); |
| 173 } | 170 } |
| 174 | 171 |
| 175 } // namespace net | 172 } // namespace net |
| OLD | NEW |