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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 | 127 |
128 // No times if the socket is reused. | 128 // No times if the socket is reused. |
129 if (is_reused) | 129 if (is_reused) |
130 return true; | 130 return true; |
131 | 131 |
132 load_timing_info->connect_timing = connect_timing_; | 132 load_timing_info->connect_timing = connect_timing_; |
133 return true; | 133 return true; |
134 } | 134 } |
135 | 135 |
136 void ClientSocketHandle::DumpMemoryStats( | 136 void ClientSocketHandle::DumpMemoryStats( |
137 base::trace_event::ProcessMemoryDump* pmd, | 137 StreamSocket::SocketMemoryStats* stats) const { |
138 const std::string& parent_absolute_name) const { | 138 socket_->DumpMemoryStats(stats); |
139 socket_->DumpMemoryStats(pmd, parent_absolute_name); | |
140 } | 139 } |
141 | 140 |
142 void ClientSocketHandle::SetSocket(std::unique_ptr<StreamSocket> s) { | 141 void ClientSocketHandle::SetSocket(std::unique_ptr<StreamSocket> s) { |
143 socket_ = std::move(s); | 142 socket_ = std::move(s); |
144 } | 143 } |
145 | 144 |
146 void ClientSocketHandle::OnIOComplete(int result) { | 145 void ClientSocketHandle::OnIOComplete(int result) { |
147 TRACE_EVENT0(kNetTracingCategory, "ClientSocketHandle::OnIOComplete"); | 146 TRACE_EVENT0(kNetTracingCategory, "ClientSocketHandle::OnIOComplete"); |
148 CompletionCallback callback = user_callback_; | 147 CompletionCallback callback = user_callback_; |
149 user_callback_.Reset(); | 148 user_callback_.Reset(); |
(...skipping 20 matching lines...) Expand all Loading... |
170 // Broadcast that the socket has been acquired. | 169 // Broadcast that the socket has been acquired. |
171 // TODO(eroman): This logging is not complete, in particular set_socket() and | 170 // TODO(eroman): This logging is not complete, in particular set_socket() and |
172 // release() socket. It ends up working though, since those methods are being | 171 // release() socket. It ends up working though, since those methods are being |
173 // used to layer sockets (and the destination sources are the same). | 172 // used to layer sockets (and the destination sources are the same). |
174 DCHECK(socket_.get()); | 173 DCHECK(socket_.get()); |
175 socket_->NetLog().BeginEvent(NetLogEventType::SOCKET_IN_USE, | 174 socket_->NetLog().BeginEvent(NetLogEventType::SOCKET_IN_USE, |
176 requesting_source_.ToEventParametersCallback()); | 175 requesting_source_.ToEventParametersCallback()); |
177 } | 176 } |
178 | 177 |
179 } // namespace net | 178 } // namespace net |
OLD | NEW |