Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(274)

Side by Side Diff: net/socket/client_socket_handle.cc

Issue 2678353003: Close idle H2 sockets when SpdySession is initialized. (Closed)
Patch Set: Address comments to hook directly to ClientSocketHandle Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/socket/client_socket_handle.h ('k') | net/socket/client_socket_pool.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 void ClientSocketHandle::RemoveHigherLayeredPool( 119 void ClientSocketHandle::RemoveHigherLayeredPool(
120 HigherLayeredPool* higher_pool) { 120 HigherLayeredPool* higher_pool) {
121 CHECK(higher_pool_); 121 CHECK(higher_pool_);
122 CHECK_EQ(higher_pool_, higher_pool); 122 CHECK_EQ(higher_pool_, higher_pool);
123 if (pool_) { 123 if (pool_) {
124 pool_->RemoveHigherLayeredPool(higher_pool); 124 pool_->RemoveHigherLayeredPool(higher_pool);
125 higher_pool_ = NULL; 125 higher_pool_ = NULL;
126 } 126 }
127 } 127 }
128 128
129 void ClientSocketHandle::CloseIdleSocketsInGroup() {
130 if (pool_)
131 pool_->CloseIdleSocketsInGroup(group_name_);
132 }
133
129 bool ClientSocketHandle::GetLoadTimingInfo( 134 bool ClientSocketHandle::GetLoadTimingInfo(
130 bool is_reused, 135 bool is_reused,
131 LoadTimingInfo* load_timing_info) const { 136 LoadTimingInfo* load_timing_info) const {
132 // Only return load timing information when there's a socket. 137 // Only return load timing information when there's a socket.
133 if (!socket_) 138 if (!socket_)
134 return false; 139 return false;
135 140
136 load_timing_info->socket_log_id = socket_->NetLog().source().id; 141 load_timing_info->socket_log_id = socket_->NetLog().source().id;
137 load_timing_info->socket_reused = is_reused; 142 load_timing_info->socket_reused = is_reused;
138 143
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 // Broadcast that the socket has been acquired. 187 // Broadcast that the socket has been acquired.
183 // TODO(eroman): This logging is not complete, in particular set_socket() and 188 // TODO(eroman): This logging is not complete, in particular set_socket() and
184 // release() socket. It ends up working though, since those methods are being 189 // release() socket. It ends up working though, since those methods are being
185 // used to layer sockets (and the destination sources are the same). 190 // used to layer sockets (and the destination sources are the same).
186 DCHECK(socket_.get()); 191 DCHECK(socket_.get());
187 socket_->NetLog().BeginEvent(NetLogEventType::SOCKET_IN_USE, 192 socket_->NetLog().BeginEvent(NetLogEventType::SOCKET_IN_USE,
188 requesting_source_.ToEventParametersCallback()); 193 requesting_source_.ToEventParametersCallback());
189 } 194 }
190 195
191 } // namespace net 196 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/client_socket_handle.h ('k') | net/socket/client_socket_pool.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698