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

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

Issue 6314010: Even more reordering the methods in headers and implementation in net/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 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/tcp_client_socket_pool.h ('k') | net/spdy/spdy_frame_builder.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/tcp_client_socket_pool.h" 5 #include "net/socket/tcp_client_socket_pool.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 return LOAD_STATE_RESOLVING_HOST; 90 return LOAD_STATE_RESOLVING_HOST;
91 case STATE_TCP_CONNECT: 91 case STATE_TCP_CONNECT:
92 case STATE_TCP_CONNECT_COMPLETE: 92 case STATE_TCP_CONNECT_COMPLETE:
93 return LOAD_STATE_CONNECTING; 93 return LOAD_STATE_CONNECTING;
94 default: 94 default:
95 NOTREACHED(); 95 NOTREACHED();
96 return LOAD_STATE_IDLE; 96 return LOAD_STATE_IDLE;
97 } 97 }
98 } 98 }
99 99
100 int TCPConnectJob::ConnectInternal() {
101 next_state_ = STATE_RESOLVE_HOST;
102 start_time_ = base::TimeTicks::Now();
103 return DoLoop(OK);
104 }
105
106 void TCPConnectJob::OnIOComplete(int result) { 100 void TCPConnectJob::OnIOComplete(int result) {
107 int rv = DoLoop(result); 101 int rv = DoLoop(result);
108 if (rv != ERR_IO_PENDING) 102 if (rv != ERR_IO_PENDING)
109 NotifyDelegateOfCompletion(rv); // Deletes |this| 103 NotifyDelegateOfCompletion(rv); // Deletes |this|
110 } 104 }
111 105
112 int TCPConnectJob::DoLoop(int result) { 106 int TCPConnectJob::DoLoop(int result) {
113 DCHECK_NE(next_state_, STATE_NONE); 107 DCHECK_NE(next_state_, STATE_NONE);
114 108
115 int rv = result; 109 int rv = result;
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 base::TimeDelta::FromMinutes(10), 175 base::TimeDelta::FromMinutes(10),
182 100); 176 100);
183 } else { 177 } else {
184 // Delete the socket on error. 178 // Delete the socket on error.
185 set_socket(NULL); 179 set_socket(NULL);
186 } 180 }
187 181
188 return result; 182 return result;
189 } 183 }
190 184
185 int TCPConnectJob::ConnectInternal() {
186 next_state_ = STATE_RESOLVE_HOST;
187 start_time_ = base::TimeTicks::Now();
188 return DoLoop(OK);
189 }
190
191 ConnectJob* TCPClientSocketPool::TCPConnectJobFactory::NewConnectJob( 191 ConnectJob* TCPClientSocketPool::TCPConnectJobFactory::NewConnectJob(
192 const std::string& group_name, 192 const std::string& group_name,
193 const PoolBase::Request& request, 193 const PoolBase::Request& request,
194 ConnectJob::Delegate* delegate) const { 194 ConnectJob::Delegate* delegate) const {
195 return new TCPConnectJob(group_name, request.params(), ConnectionTimeout(), 195 return new TCPConnectJob(group_name, request.params(), ConnectionTimeout(),
196 client_socket_factory_, host_resolver_, delegate, 196 client_socket_factory_, host_resolver_, delegate,
197 net_log_); 197 net_log_);
198 } 198 }
199 199
200 base::TimeDelta 200 base::TimeDelta
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 307
308 base::TimeDelta TCPClientSocketPool::ConnectionTimeout() const { 308 base::TimeDelta TCPClientSocketPool::ConnectionTimeout() const {
309 return base_.ConnectionTimeout(); 309 return base_.ConnectionTimeout();
310 } 310 }
311 311
312 ClientSocketPoolHistograms* TCPClientSocketPool::histograms() const { 312 ClientSocketPoolHistograms* TCPClientSocketPool::histograms() const {
313 return base_.histograms(); 313 return base_.histograms();
314 } 314 }
315 315
316 } // namespace net 316 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/tcp_client_socket_pool.h ('k') | net/spdy/spdy_frame_builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698