summaryrefslogtreecommitdiffstats
path: root/net/socket
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-02 20:15:57 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-02 20:15:57 +0000
commit00cd9c4e71d1e6dd6cc3a2fff60505479304c9d1 (patch)
treeeb61d6402a5e967e5eb1d41dfde730af48dfa55f /net/socket
parentd9b888cdf9ad654a3f2e5c22b935e68db77a71ef (diff)
downloadchromium_src-00cd9c4e71d1e6dd6cc3a2fff60505479304c9d1.zip
chromium_src-00cd9c4e71d1e6dd6cc3a2fff60505479304c9d1.tar.gz
chromium_src-00cd9c4e71d1e6dd6cc3a2fff60505479304c9d1.tar.bz2
Convert implicit scoped_refptr constructor calls to explicit ones, part 2
This CL was created automatically by this clang rewriter: http://codereview.appspot.com/2826041 I then did quite a bit of manual editing to fix style issues. BUG=28083 TEST=None Review URL: http://codereview.chromium.org/4291001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64798 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket')
-rw-r--r--net/socket/client_socket_handle.cc3
-rw-r--r--net/socket/client_socket_pool_base.cc26
-rw-r--r--net/socket/socks5_client_socket.cc28
-rw-r--r--net/socket/ssl_client_socket_nss.cc27
-rw-r--r--net/socket/tcp_client_socket_libevent.cc9
-rw-r--r--net/socket/tcp_client_socket_pool.cc8
6 files changed, 59 insertions, 42 deletions
diff --git a/net/socket/client_socket_handle.cc b/net/socket/client_socket_handle.cc
index 6184905..29b5bd3 100644
--- a/net/socket/client_socket_handle.cc
+++ b/net/socket/client_socket_handle.cc
@@ -116,7 +116,8 @@ void ClientSocketHandle::HandleInitCompletion(int result) {
DCHECK(socket_.get());
socket_->NetLog().BeginEvent(
NetLog::TYPE_SOCKET_IN_USE,
- new NetLogSourceParameter("source_dependency", requesting_source_));
+ make_scoped_refptr(new NetLogSourceParameter(
+ "source_dependency", requesting_source_)));
}
} // namespace net
diff --git a/net/socket/client_socket_pool_base.cc b/net/socket/client_socket_pool_base.cc
index 75abae6d..2228729 100644
--- a/net/socket/client_socket_pool_base.cc
+++ b/net/socket/client_socket_pool_base.cc
@@ -87,9 +87,9 @@ void ConnectJob::UseForNormalRequest() {
void ConnectJob::set_socket(ClientSocket* socket) {
if (socket) {
- net_log().AddEvent(NetLog::TYPE_CONNECT_JOB_SET_SOCKET,
- new NetLogSourceParameter("source_dependency",
- socket->NetLog().source()));
+ net_log().AddEvent(NetLog::TYPE_CONNECT_JOB_SET_SOCKET, make_scoped_refptr(
+ new NetLogSourceParameter("source_dependency",
+ socket->NetLog().source())));
}
socket_.reset(socket);
}
@@ -110,7 +110,7 @@ void ConnectJob::ResetTimer(base::TimeDelta remaining_time) {
void ConnectJob::LogConnectStart() {
net_log().BeginEvent(NetLog::TYPE_SOCKET_POOL_CONNECT_JOB_CONNECT,
- new NetLogStringParameter("group_name", group_name_));
+ make_scoped_refptr(new NetLogStringParameter("group_name", group_name_)));
}
void ConnectJob::LogConnectCompletion(int net_error) {
@@ -239,7 +239,8 @@ void ClientSocketPoolBaseHelper::RequestSockets(
request.net_log().BeginEvent(
NetLog::TYPE_SOCKET_POOL_CONNECTING_N_SOCKETS,
- new NetLogIntegerParameter("num_sockets", num_sockets));
+ make_scoped_refptr(new NetLogIntegerParameter(
+ "num_sockets", num_sockets)));
Group* group = GetOrCreateGroup(group_name);
@@ -394,7 +395,8 @@ void ClientSocketPoolBaseHelper::LogBoundConnectJobToRequest(
const NetLog::Source& connect_job_source, const Request* request) {
request->net_log().AddEvent(
NetLog::TYPE_SOCKET_POOL_BOUND_TO_CONNECT_JOB,
- new NetLogSourceParameter("source_dependency", connect_job_source));
+ make_scoped_refptr(new NetLogSourceParameter(
+ "source_dependency", connect_job_source)));
}
void ClientSocketPoolBaseHelper::CancelRequest(
@@ -763,8 +765,8 @@ void ClientSocketPoolBaseHelper::OnConnectJobComplete(
HandOutSocket(socket.release(), false /* unused socket */, r->handle(),
base::TimeDelta(), group, r->net_log());
}
- r->net_log().EndEvent(NetLog::TYPE_SOCKET_POOL,
- new NetLogIntegerParameter("net_error", result));
+ r->net_log().EndEvent(NetLog::TYPE_SOCKET_POOL, make_scoped_refptr(
+ new NetLogIntegerParameter("net_error", result)));
InvokeUserCallbackLater(r->handle(), r->callback(), result);
} else {
RemoveConnectJob(job, group);
@@ -849,13 +851,13 @@ void ClientSocketPoolBaseHelper::HandOutSocket(
if (reused) {
net_log.AddEvent(
NetLog::TYPE_SOCKET_POOL_REUSED_AN_EXISTING_SOCKET,
- new NetLogIntegerParameter(
- "idle_ms", static_cast<int>(idle_time.InMilliseconds())));
+ make_scoped_refptr(new NetLogIntegerParameter(
+ "idle_ms", static_cast<int>(idle_time.InMilliseconds()))));
}
net_log.AddEvent(NetLog::TYPE_SOCKET_POOL_BOUND_TO_SOCKET,
- new NetLogSourceParameter(
- "source_dependency", socket->NetLog().source()));
+ make_scoped_refptr(new NetLogSourceParameter(
+ "source_dependency", socket->NetLog().source())));
handed_out_socket_count_++;
group->IncrementActiveSocketCount();
diff --git a/net/socket/socks5_client_socket.cc b/net/socket/socks5_client_socket.cc
index 6e28a490..f73b558 100644
--- a/net/socket/socks5_client_socket.cc
+++ b/net/socket/socks5_client_socket.cc
@@ -308,13 +308,15 @@ int SOCKS5ClientSocket::DoGreetReadComplete(int result) {
// Got the greet data.
if (buffer_[0] != kSOCKS5Version) {
- net_log_.AddEvent(NetLog::TYPE_SOCKS_UNEXPECTED_VERSION,
- new NetLogIntegerParameter("version", buffer_[0]));
+ net_log_.AddEvent(
+ NetLog::TYPE_SOCKS_UNEXPECTED_VERSION,
+ make_scoped_refptr(new NetLogIntegerParameter("version", buffer_[0])));
return ERR_SOCKS_CONNECTION_FAILED;
}
if (buffer_[1] != 0x00) {
- net_log_.AddEvent(NetLog::TYPE_SOCKS_UNEXPECTED_AUTH,
- new NetLogIntegerParameter("method", buffer_[1]));
+ net_log_.AddEvent(
+ NetLog::TYPE_SOCKS_UNEXPECTED_AUTH,
+ make_scoped_refptr(new NetLogIntegerParameter("method", buffer_[1])));
return ERR_SOCKS_CONNECTION_FAILED;
}
@@ -417,13 +419,17 @@ int SOCKS5ClientSocket::DoHandshakeReadComplete(int result) {
// and accordingly increase them
if (bytes_received_ == kReadHeaderSize) {
if (buffer_[0] != kSOCKS5Version || buffer_[2] != kNullByte) {
- net_log_.AddEvent(NetLog::TYPE_SOCKS_UNEXPECTED_VERSION,
- new NetLogIntegerParameter("version", buffer_[0]));
+ net_log_.AddEvent(
+ NetLog::TYPE_SOCKS_UNEXPECTED_VERSION,
+ make_scoped_refptr(
+ new NetLogIntegerParameter("version", buffer_[0])));
return ERR_SOCKS_CONNECTION_FAILED;
}
if (buffer_[1] != 0x00) {
- net_log_.AddEvent(NetLog::TYPE_SOCKS_SERVER_ERROR,
- new NetLogIntegerParameter("error_code", buffer_[1]));
+ net_log_.AddEvent(
+ NetLog::TYPE_SOCKS_SERVER_ERROR,
+ make_scoped_refptr(
+ new NetLogIntegerParameter("error_code", buffer_[1])));
return ERR_SOCKS_CONNECTION_FAILED;
}
@@ -441,8 +447,10 @@ int SOCKS5ClientSocket::DoHandshakeReadComplete(int result) {
else if (address_type == kEndPointResolvedIPv6)
read_header_size += sizeof(struct in6_addr) - 1;
else {
- net_log_.AddEvent(NetLog::TYPE_SOCKS_UNKNOWN_ADDRESS_TYPE,
- new NetLogIntegerParameter("address_type", buffer_[3]));
+ net_log_.AddEvent(
+ NetLog::TYPE_SOCKS_UNKNOWN_ADDRESS_TYPE,
+ make_scoped_refptr(
+ new NetLogIntegerParameter("address_type", buffer_[3])));
return ERR_SOCKS_CONNECTION_FAILED;
}
diff --git a/net/socket/ssl_client_socket_nss.cc b/net/socket/ssl_client_socket_nss.cc
index 5e60778..3a1e3c78 100644
--- a/net/socket/ssl_client_socket_nss.cc
+++ b/net/socket/ssl_client_socket_nss.cc
@@ -317,8 +317,9 @@ class SSLFailedNSSFunctionParams : public NetLog::EventParameters {
void LogFailedNSSFunction(const BoundNetLog& net_log,
const char* function,
const char* param) {
- net_log.AddEvent(NetLog::TYPE_SSL_NSS_ERROR,
- new SSLFailedNSSFunctionParams(function, param));
+ net_log.AddEvent(
+ NetLog::TYPE_SSL_NSS_ERROR,
+ make_scoped_refptr(new SSLFailedNSSFunctionParams(function, param)));
}
#if defined(OS_WIN)
@@ -1545,7 +1546,8 @@ int SSLClientSocketNSS::DoReadLoop(int result) {
if (!nss_bufs_) {
LOG(DFATAL) << "!nss_bufs_";
int rv = ERR_UNEXPECTED;
- net_log_.AddEvent(NetLog::TYPE_SSL_READ_ERROR, new SSLErrorParams(rv, 0));
+ net_log_.AddEvent(NetLog::TYPE_SSL_READ_ERROR,
+ make_scoped_refptr(new SSLErrorParams(rv, 0)));
return rv;
}
@@ -1571,7 +1573,8 @@ int SSLClientSocketNSS::DoWriteLoop(int result) {
if (!nss_bufs_) {
LOG(DFATAL) << "!nss_bufs_";
int rv = ERR_UNEXPECTED;
- net_log_.AddEvent(NetLog::TYPE_SSL_WRITE_ERROR, new SSLErrorParams(rv, 0));
+ net_log_.AddEvent(NetLog::TYPE_SSL_WRITE_ERROR,
+ make_scoped_refptr(new SSLErrorParams(rv, 0)));
return rv;
}
@@ -1900,7 +1903,7 @@ int SSLClientSocketNSS::DoHandshake() {
if (client_auth_cert_needed_) {
net_error = ERR_SSL_CLIENT_AUTH_CERT_NEEDED;
net_log_.AddEvent(NetLog::TYPE_SSL_HANDSHAKE_ERROR,
- new SSLErrorParams(net_error, 0));
+ make_scoped_refptr(new SSLErrorParams(net_error, 0)));
// If the handshake already succeeded (because the server requests but
// doesn't require a client cert), we need to invalidate the SSL session
// so that we won't try to resume the non-client-authenticated session in
@@ -1957,7 +1960,7 @@ int SSLClientSocketNSS::DoHandshake() {
rv = SECFailure;
net_error = ERR_SSL_PROTOCOL_ERROR;
net_log_.AddEvent(NetLog::TYPE_SSL_HANDSHAKE_ERROR,
- new SSLErrorParams(net_error, 0));
+ make_scoped_refptr(new SSLErrorParams(net_error, 0)));
}
} else {
PRErrorCode prerr = PR_GetError();
@@ -1969,8 +1972,9 @@ int SSLClientSocketNSS::DoHandshake() {
} else {
LOG(ERROR) << "handshake failed; NSS error code " << prerr
<< ", net_error " << net_error;
- net_log_.AddEvent(NetLog::TYPE_SSL_HANDSHAKE_ERROR,
- new SSLErrorParams(net_error, prerr));
+ net_log_.AddEvent(
+ NetLog::TYPE_SSL_HANDSHAKE_ERROR,
+ make_scoped_refptr(new SSLErrorParams(net_error, prerr)));
}
}
@@ -2288,7 +2292,7 @@ int SSLClientSocketNSS::DoPayloadRead() {
LeaveFunction("");
rv = ERR_SSL_CLIENT_AUTH_CERT_NEEDED;
net_log_.AddEvent(NetLog::TYPE_SSL_READ_ERROR,
- new SSLErrorParams(rv, 0));
+ make_scoped_refptr(new SSLErrorParams(rv, 0)));
return rv;
}
if (rv >= 0) {
@@ -2303,7 +2307,8 @@ int SSLClientSocketNSS::DoPayloadRead() {
}
LeaveFunction("");
rv = MapNSPRError(prerr);
- net_log_.AddEvent(NetLog::TYPE_SSL_READ_ERROR, new SSLErrorParams(rv, prerr));
+ net_log_.AddEvent(NetLog::TYPE_SSL_READ_ERROR,
+ make_scoped_refptr(new SSLErrorParams(rv, prerr)));
return rv;
}
@@ -2324,7 +2329,7 @@ int SSLClientSocketNSS::DoPayloadWrite() {
LeaveFunction("");
rv = MapNSPRError(prerr);
net_log_.AddEvent(NetLog::TYPE_SSL_WRITE_ERROR,
- new SSLErrorParams(rv, prerr));
+ make_scoped_refptr(new SSLErrorParams(rv, prerr)));
return rv;
}
diff --git a/net/socket/tcp_client_socket_libevent.cc b/net/socket/tcp_client_socket_libevent.cc
index 1367433..1bbe827 100644
--- a/net/socket/tcp_client_socket_libevent.cc
+++ b/net/socket/tcp_client_socket_libevent.cc
@@ -152,8 +152,9 @@ int TCPClientSocketLibevent::Connect(CompletionCallback* callback) {
DCHECK(!waiting_connect());
- net_log_.BeginEvent(NetLog::TYPE_TCP_CONNECT,
- new AddressListNetLogParam(addresses_));
+ net_log_.BeginEvent(
+ NetLog::TYPE_TCP_CONNECT,
+ make_scoped_refptr(new AddressListNetLogParam(addresses_)));
// We will try to connect to each address in addresses_. Start with the
// first one in the list.
@@ -208,8 +209,8 @@ int TCPClientSocketLibevent::DoConnect() {
}
net_log_.BeginEvent(NetLog::TYPE_TCP_CONNECT_ATTEMPT,
- new NetLogStringParameter(
- "address", NetAddressToStringWithPort(current_ai_)));
+ make_scoped_refptr(new NetLogStringParameter(
+ "address", NetAddressToStringWithPort(current_ai_))));
next_connect_state_ = CONNECT_STATE_CONNECT_COMPLETE;
diff --git a/net/socket/tcp_client_socket_pool.cc b/net/socket/tcp_client_socket_pool.cc
index 5f1f43f..8ec9cac 100644
--- a/net/socket/tcp_client_socket_pool.cc
+++ b/net/socket/tcp_client_socket_pool.cc
@@ -222,9 +222,9 @@ int TCPClientSocketPool::RequestSocket(
// TODO(eroman): Split out the host and port parameters.
net_log.AddEvent(
NetLog::TYPE_TCP_CLIENT_SOCKET_POOL_REQUESTED_SOCKET,
- new NetLogStringParameter(
+ make_scoped_refptr(new NetLogStringParameter(
"host_and_port",
- casted_params->get()->destination().host_port_pair().ToString()));
+ casted_params->get()->destination().host_port_pair().ToString())));
}
return base_.RequestSocket(group_name, *casted_params, priority, handle,
@@ -243,9 +243,9 @@ void TCPClientSocketPool::RequestSockets(
// TODO(eroman): Split out the host and port parameters.
net_log.AddEvent(
NetLog::TYPE_TCP_CLIENT_SOCKET_POOL_REQUESTED_SOCKETS,
- new NetLogStringParameter(
+ make_scoped_refptr(new NetLogStringParameter(
"host_and_port",
- casted_params->get()->destination().host_port_pair().ToString()));
+ casted_params->get()->destination().host_port_pair().ToString())));
}
base_.RequestSockets(group_name, *casted_params, num_sockets, net_log);