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

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

Issue 3071022: Reland 54771 (and 54795) To enable TCP Preconnection by default... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « net/socket/client_socket_handle.h ('k') | net/socket/client_socket_pool_base.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Deleted: svn:mergeinfo
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/histogram.h" 8 #include "base/histogram.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "net/base/net_errors.h" 10 #include "net/base/net_errors.h"
11 #include "net/socket/client_socket_pool.h" 11 #include "net/socket/client_socket_pool.h"
12 #include "net/socket/client_socket_pool_histograms.h" 12 #include "net/socket/client_socket_pool_histograms.h"
13 13
14 namespace net { 14 namespace net {
15 15
16 ClientSocketHandle::ClientSocketHandle() 16 ClientSocketHandle::ClientSocketHandle()
17 : is_initialized_(false), 17 : is_initialized_(false),
18 is_reused_(false), 18 is_reused_(false),
19 ALLOW_THIS_IN_INITIALIZER_LIST( 19 ALLOW_THIS_IN_INITIALIZER_LIST(
20 callback_(this, &ClientSocketHandle::OnIOComplete)), 20 callback_(this, &ClientSocketHandle::OnIOComplete)),
21 is_ssl_error_(false) {} 21 is_ssl_error_(false) {}
22 22
23 ClientSocketHandle::~ClientSocketHandle() { 23 ClientSocketHandle::~ClientSocketHandle() {
24 Reset(); 24 Reset();
25 // Manually release socket, so that we also cause state to be recorded into
26 // associated socket_ as needed.
27 release_socket();
25 } 28 }
26 29
27 void ClientSocketHandle::Reset() { 30 void ClientSocketHandle::Reset() {
28 ResetInternal(true); 31 ResetInternal(true);
29 ResetErrorState(); 32 ResetErrorState();
30 } 33 }
31 34
32 void ClientSocketHandle::ResetInternal(bool cancel) { 35 void ClientSocketHandle::ResetInternal(bool cancel) {
33 if (group_name_.empty()) // Was Init called? 36 if (group_name_.empty()) // Was Init called?
34 return; 37 return;
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 // TODO(eroman): This logging is not complete, in particular set_socket() and 116 // TODO(eroman): This logging is not complete, in particular set_socket() and
114 // release() socket. It ends up working though, since those methods are being 117 // release() socket. It ends up working though, since those methods are being
115 // used to layer sockets (and the destination sources are the same). 118 // used to layer sockets (and the destination sources are the same).
116 DCHECK(socket_.get()); 119 DCHECK(socket_.get());
117 socket_->NetLog().BeginEvent( 120 socket_->NetLog().BeginEvent(
118 NetLog::TYPE_SOCKET_IN_USE, 121 NetLog::TYPE_SOCKET_IN_USE,
119 new NetLogSourceParameter("source_dependency", requesting_source_)); 122 new NetLogSourceParameter("source_dependency", requesting_source_));
120 } 123 }
121 124
122 } // namespace net 125 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/client_socket_handle.h ('k') | net/socket/client_socket_pool_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698