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

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

Issue 3050040: 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')
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 UpdateConnectivityStateForSocket();
25 } 26 }
26 27
27 void ClientSocketHandle::Reset() { 28 void ClientSocketHandle::Reset() {
28 ResetInternal(true); 29 ResetInternal(true);
29 ResetErrorState(); 30 ResetErrorState();
30 } 31 }
31 32
32 void ClientSocketHandle::ResetInternal(bool cancel) { 33 void ClientSocketHandle::ResetInternal(bool cancel) {
33 if (group_name_.empty()) // Was Init called? 34 if (group_name_.empty()) // Was Init called?
34 return; 35 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 114 // 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 115 // release() socket. It ends up working though, since those methods are being
115 // used to layer sockets (and the destination sources are the same). 116 // used to layer sockets (and the destination sources are the same).
116 DCHECK(socket_.get()); 117 DCHECK(socket_.get());
117 socket_->NetLog().BeginEvent( 118 socket_->NetLog().BeginEvent(
118 NetLog::TYPE_SOCKET_IN_USE, 119 NetLog::TYPE_SOCKET_IN_USE,
119 new NetLogSourceParameter("source_dependency", requesting_source_)); 120 new NetLogSourceParameter("source_dependency", requesting_source_));
120 } 121 }
121 122
122 } // namespace net 123 } // 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