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

Unified Diff: net/socket/socket_test_util.cc

Issue 2994003: Refactor how ClientSocketPoolBaseHelper avoids re-entrancy. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Merge. Created 10 years, 5 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 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 bb403540efa35618d092427b7638490731dca851..0d755160991ca3b19ac96d735a72aec103822a59 100644
--- a/net/socket/socket_test_util.cc
+++ b/net/socket/socket_test_util.cc
@@ -792,10 +792,11 @@ bool MockTCPClientSocketPool::MockConnectJob::CancelHandle(
void MockTCPClientSocketPool::MockConnectJob::OnConnect(int rv) {
if (!socket_.get())
return;
- if (rv == OK)
+ if (rv == OK) {
handle_->set_socket(socket_.release());
- else
+ } else {
socket_.reset();
+ }
handle_ = NULL;
@@ -833,7 +834,7 @@ int MockTCPClientSocketPool::RequestSocket(const std::string& group_name,
}
void MockTCPClientSocketPool::CancelRequest(const std::string& group_name,
- const ClientSocketHandle* handle) {
+ ClientSocketHandle* handle) {
std::vector<MockConnectJob*>::iterator i;
for (i = job_list_.begin(); i != job_list_.end(); ++i) {
if ((*i)->CancelHandle(handle)) {
@@ -874,7 +875,7 @@ int MockSOCKSClientSocketPool::RequestSocket(const std::string& group_name,
void MockSOCKSClientSocketPool::CancelRequest(
const std::string& group_name,
- const ClientSocketHandle* handle) {
+ ClientSocketHandle* handle) {
return tcp_pool_->CancelRequest(group_name, handle);
}
« 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