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

Unified Diff: net/socket/socket_test_util.cc

Issue 8990001: base::Bind: Convert most of net/http. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clang. Created 9 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/socket/socket_test_util.h ('k') | net/socket/socks_client_socket_pool.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/socket_test_util.cc
diff --git a/net/socket/socket_test_util.cc b/net/socket/socket_test_util.cc
index 9e437aab417b5c22defefc4560a5842250413afe..b8279801cbac224429f3a0bc13821683ea9f78ac 100644
--- a/net/socket/socket_test_util.cc
+++ b/net/socket/socket_test_util.cc
@@ -339,8 +339,6 @@ void OrderedSocketData::EndLoop() {
NET_TRACE(INFO, " *** ") << "Stage " << sequence_number_
<< ": Posting Quit at read " << read_index();
loop_stop_stage_ = sequence_number_;
- if (!callback_.is_null())
awong 2011/12/20 21:51:35 Are we sure we are supposed to remove this?
James Hawkins 2011/12/20 22:50:48 Yes, the variable is completely unused because it'
- callback_.Run(ERR_IO_PENDING);
}
MockRead OrderedSocketData::GetNextRead() {
@@ -1468,20 +1466,12 @@ MockTransportClientSocketPool::MockTransportClientSocketPool(
MockTransportClientSocketPool::~MockTransportClientSocketPool() {}
int MockTransportClientSocketPool::RequestSocket(
- const std::string& group_name,
- const void* socket_params,
- RequestPriority priority,
- ClientSocketHandle* handle,
- OldCompletionCallback* callback,
- const BoundNetLog& net_log) {
+ const std::string& group_name, const void* socket_params,
+ RequestPriority priority, ClientSocketHandle* handle,
+ const CompletionCallback& callback, const BoundNetLog& net_log) {
StreamSocket* socket = client_socket_factory_->CreateTransportClientSocket(
AddressList(), net_log.net_log(), net::NetLog::Source());
- CompletionCallback cb;
- if (callback) {
- cb = base::Bind(&OldCompletionCallback::Run<int>,
- base::Unretained(callback));
- }
- MockConnectJob* job = new MockConnectJob(socket, handle, cb);
+ MockConnectJob* job = new MockConnectJob(socket, handle, callback);
job_list_.push_back(job);
handle->set_pool_id(1);
return job->Connect();
@@ -1580,18 +1570,12 @@ MockSOCKSClientSocketPool::MockSOCKSClientSocketPool(
MockSOCKSClientSocketPool::~MockSOCKSClientSocketPool() {}
-int MockSOCKSClientSocketPool::RequestSocket(const std::string& group_name,
- const void* socket_params,
- RequestPriority priority,
- ClientSocketHandle* handle,
- OldCompletionCallback* callback,
- const BoundNetLog& net_log) {
- return transport_pool_->RequestSocket(group_name,
- socket_params,
- priority,
- handle,
- callback,
- net_log);
+int MockSOCKSClientSocketPool::RequestSocket(
+ const std::string& group_name, const void* socket_params,
+ RequestPriority priority, ClientSocketHandle* handle,
+ const CompletionCallback& callback, const BoundNetLog& net_log) {
+ return transport_pool_->RequestSocket(
+ group_name, socket_params, priority, handle, callback, net_log);
}
void MockSOCKSClientSocketPool::CancelRequest(
« no previous file with comments | « net/socket/socket_test_util.h ('k') | net/socket/socks_client_socket_pool.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698