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

Unified Diff: net/socket/socket_test_util.cc

Issue 8898036: base::Bind: Convert proxy_resolving_client_socket.[cc,h] and deps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Possible test fix. 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 ff8bc505f5e73fb2cef5e95e10def7614c967739..9e437aab417b5c22defefc4560a5842250413afe 100644
--- a/net/socket/socket_test_util.cc
+++ b/net/socket/socket_test_util.cc
@@ -1344,10 +1344,11 @@ void MockUDPClientSocket::RunCallback(const CompletionCallback& callback,
}
TestSocketRequest::TestSocketRequest(
- std::vector<TestSocketRequest*>* request_order,
- size_t* completion_count)
+ std::vector<TestSocketRequest*>* request_order, size_t* completion_count)
: request_order_(request_order),
- completion_count_(completion_count) {
+ completion_count_(completion_count),
+ ALLOW_THIS_IN_INITIALIZER_LIST(callback_(
+ base::Bind(&TestSocketRequest::OnComplete, base::Unretained(this)))) {
DCHECK(request_order);
DCHECK(completion_count);
}
@@ -1355,12 +1356,8 @@ TestSocketRequest::TestSocketRequest(
TestSocketRequest::~TestSocketRequest() {
}
-int TestSocketRequest::WaitForResult() {
- return callback_.WaitForResult();
-}
-
-void TestSocketRequest::RunWithParams(const Tuple1<int>& params) {
- callback_.RunWithParams(params);
+void TestSocketRequest::OnComplete(int result) {
+ SetResult(result);
(*completion_count_)++;
request_order_->push_back(this);
}
« 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