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

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

Issue 344026: Add LoadLog to ClientSocket::Connect(). (Closed)
Patch Set: Minor build fixups and fixed mac bug. Created 11 years, 1 month 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/socket_test_util.h ('k') | net/socket/socks5_client_socket.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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/socket_test_util.h" 5 #include "net/socket/socket_test_util.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 net::MockSocket* socket) 65 net::MockSocket* socket)
66 : addresses_(addresses), 66 : addresses_(addresses),
67 data_(socket), 67 data_(socket),
68 read_offset_(0), 68 read_offset_(0),
69 read_data_(true, net::ERR_UNEXPECTED), 69 read_data_(true, net::ERR_UNEXPECTED),
70 need_read_data_(true) { 70 need_read_data_(true) {
71 DCHECK(data_); 71 DCHECK(data_);
72 data_->Reset(); 72 data_->Reset();
73 } 73 }
74 74
75 int MockTCPClientSocket::Connect(net::CompletionCallback* callback) { 75 int MockTCPClientSocket::Connect(net::CompletionCallback* callback,
76 LoadLog* load_log) {
76 if (connected_) 77 if (connected_)
77 return net::OK; 78 return net::OK;
78 connected_ = true; 79 connected_ = true;
79 if (data_->connect_data().async) { 80 if (data_->connect_data().async) {
80 RunCallbackAsync(callback, data_->connect_data().result); 81 RunCallbackAsync(callback, data_->connect_data().result);
81 return net::ERR_IO_PENDING; 82 return net::ERR_IO_PENDING;
82 } 83 }
83 return data_->connect_data().result; 84 return data_->connect_data().result;
84 } 85 }
85 86
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 } 170 }
170 171
171 MockSSLClientSocket::~MockSSLClientSocket() { 172 MockSSLClientSocket::~MockSSLClientSocket() {
172 Disconnect(); 173 Disconnect();
173 } 174 }
174 175
175 void MockSSLClientSocket::GetSSLInfo(net::SSLInfo* ssl_info) { 176 void MockSSLClientSocket::GetSSLInfo(net::SSLInfo* ssl_info) {
176 ssl_info->Reset(); 177 ssl_info->Reset();
177 } 178 }
178 179
179 int MockSSLClientSocket::Connect(net::CompletionCallback* callback) { 180 int MockSSLClientSocket::Connect(net::CompletionCallback* callback,
181 LoadLog* load_log) {
180 ConnectCallback* connect_callback = new ConnectCallback( 182 ConnectCallback* connect_callback = new ConnectCallback(
181 this, callback, data_->connect.result); 183 this, callback, data_->connect.result);
182 int rv = transport_->Connect(connect_callback); 184 int rv = transport_->Connect(connect_callback, load_log);
183 if (rv == net::OK) { 185 if (rv == net::OK) {
184 delete connect_callback; 186 delete connect_callback;
185 if (data_->connect.async) { 187 if (data_->connect.async) {
186 RunCallbackAsync(callback, data_->connect.result); 188 RunCallbackAsync(callback, data_->connect.result);
187 return net::ERR_IO_PENDING; 189 return net::ERR_IO_PENDING;
188 } 190 }
189 if (data_->connect.result == net::OK) 191 if (data_->connect.result == net::OK)
190 connected_ = true; 192 connected_ = true;
191 return data_->connect.result; 193 return data_->connect.result;
192 } 194 }
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 } 375 }
374 376
375 void ClientSocketPoolTest::ReleaseAllConnections(KeepAlive keep_alive) { 377 void ClientSocketPoolTest::ReleaseAllConnections(KeepAlive keep_alive) {
376 bool released_one; 378 bool released_one;
377 do { 379 do {
378 released_one = ReleaseOneConnection(keep_alive); 380 released_one = ReleaseOneConnection(keep_alive);
379 } while (released_one); 381 } while (released_one);
380 } 382 }
381 383
382 } // namespace net 384 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/socket_test_util.h ('k') | net/socket/socks5_client_socket.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698