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

Unified Diff: net/socket/client_socket_pool_base.cc

Issue 1756019: Fix some uses of scoped_ptr.release() in net/ such that the return value is not ignored. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: add back the change that got lost in the void Created 10 years, 8 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/client_socket_pool_base.h ('k') | net/socket/socks_client_socket_pool_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/client_socket_pool_base.cc
diff --git a/net/socket/client_socket_pool_base.cc b/net/socket/client_socket_pool_base.cc
index 739bb82ab4676ac3e9d1414fcaa013d6d16acf43..9fe07d38ecb73cafce239634c083c868e5ded03e 100644
--- a/net/socket/client_socket_pool_base.cc
+++ b/net/socket/client_socket_pool_base.cc
@@ -175,10 +175,12 @@ int ClientSocketPoolBaseHelper::RequestSocket(
request->net_log().BeginEvent(NetLog::TYPE_SOCKET_POOL, NULL);
Group& group = group_map_[group_name];
int rv = RequestSocketInternal(group_name, request);
- if (rv != ERR_IO_PENDING)
+ if (rv != ERR_IO_PENDING) {
request->net_log().EndEvent(NetLog::TYPE_SOCKET_POOL, NULL);
- else
+ delete request;
+ } else {
InsertRequestIntoQueue(request, &group.pending_requests);
+ }
return rv;
}
@@ -654,21 +656,18 @@ void ClientSocketPoolBaseHelper::OnAvailableSocketSlot(
void ClientSocketPoolBaseHelper::ProcessPendingRequest(
const std::string& group_name, Group* group) {
- scoped_ptr<const Request> r(*group->pending_requests.begin());
- int rv = RequestSocketInternal(group_name, r.get());
+ int rv = RequestSocketInternal(group_name, *group->pending_requests.begin());
if (rv != ERR_IO_PENDING) {
+ scoped_ptr<const Request> r(RemoveRequestFromQueue(
+ group->pending_requests.begin(), &group->pending_requests));
r->net_log().EndEvent(NetLog::TYPE_SOCKET_POOL, NULL);
- RemoveRequestFromQueue(group->pending_requests.begin(),
- &group->pending_requests);
r->callback()->Run(rv);
if (rv != OK) {
// |group| may be invalid after the callback, we need to search
// |group_map_| again.
MaybeOnAvailableSocketSlot(group_name);
}
- } else {
- r.release();
}
}
« no previous file with comments | « net/socket/client_socket_pool_base.h ('k') | net/socket/socks_client_socket_pool_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698