Converted bare pointer to scoped_ptr<> in net/socket and net/http
BUG=479898 R=eroman@chromium.org Review URL: https://codereview.chromium.org/1158193006 Cr-Commit-Position: refs/heads/master@{#332587}
This commit is contained in:
AUTHORS
net
http
socket
client_socket_pool.hclient_socket_pool_base.ccclient_socket_pool_base.hclient_socket_pool_base_unittest.ccsocks_client_socket_pool.ccsocks_client_socket_pool.hssl_client_socket_pool.ccssl_client_socket_pool.htransport_client_socket_pool.cctransport_client_socket_pool.hwebsocket_transport_client_socket_pool.ccwebsocket_transport_client_socket_pool.h
1
AUTHORS
1
AUTHORS
@@ -296,6 +296,7 @@ Kaustubh Atrawalkar <kaustubh.a@samsung.com>
|
|||||||
Keene Pan <keenepan@linpus.com>
|
Keene Pan <keenepan@linpus.com>
|
||||||
Kenneth Rohde Christiansen <kenneth.r.christiansen@intel.com>
|
Kenneth Rohde Christiansen <kenneth.r.christiansen@intel.com>
|
||||||
Keonho Kim <keonho07.kim@samsung.com>
|
Keonho Kim <keonho07.kim@samsung.com>
|
||||||
|
Ketan Goyal <ketan.goyal@samsung.com>
|
||||||
Kevin Lee Helpingstine <sig11@reprehensible.net>
|
Kevin Lee Helpingstine <sig11@reprehensible.net>
|
||||||
Kevin M. McCormick <mckev@amazon.com>
|
Kevin M. McCormick <mckev@amazon.com>
|
||||||
Kihong Kwon <kihong.kwon@samsung.com>
|
Kihong Kwon <kihong.kwon@samsung.com>
|
||||||
|
@@ -511,11 +511,11 @@ LoadState HttpProxyClientSocketPool::GetLoadState(
|
|||||||
return base_.GetLoadState(group_name, handle);
|
return base_.GetLoadState(group_name, handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
base::DictionaryValue* HttpProxyClientSocketPool::GetInfoAsValue(
|
scoped_ptr<base::DictionaryValue> HttpProxyClientSocketPool::GetInfoAsValue(
|
||||||
const std::string& name,
|
const std::string& name,
|
||||||
const std::string& type,
|
const std::string& type,
|
||||||
bool include_nested_pools) const {
|
bool include_nested_pools) const {
|
||||||
base::DictionaryValue* dict = base_.GetInfoAsValue(name, type);
|
scoped_ptr<base::DictionaryValue> dict(base_.GetInfoAsValue(name, type));
|
||||||
if (include_nested_pools) {
|
if (include_nested_pools) {
|
||||||
base::ListValue* list = new base::ListValue();
|
base::ListValue* list = new base::ListValue();
|
||||||
if (transport_pool_) {
|
if (transport_pool_) {
|
||||||
@@ -530,7 +530,7 @@ base::DictionaryValue* HttpProxyClientSocketPool::GetInfoAsValue(
|
|||||||
}
|
}
|
||||||
dict->Set("nested_pools", list);
|
dict->Set("nested_pools", list);
|
||||||
}
|
}
|
||||||
return dict;
|
return dict.Pass();
|
||||||
}
|
}
|
||||||
|
|
||||||
base::TimeDelta HttpProxyClientSocketPool::ConnectionTimeout() const {
|
base::TimeDelta HttpProxyClientSocketPool::ConnectionTimeout() const {
|
||||||
|
@@ -221,7 +221,7 @@ class NET_EXPORT_PRIVATE HttpProxyClientSocketPool
|
|||||||
LoadState GetLoadState(const std::string& group_name,
|
LoadState GetLoadState(const std::string& group_name,
|
||||||
const ClientSocketHandle* handle) const override;
|
const ClientSocketHandle* handle) const override;
|
||||||
|
|
||||||
base::DictionaryValue* GetInfoAsValue(
|
scoped_ptr<base::DictionaryValue> GetInfoAsValue(
|
||||||
const std::string& name,
|
const std::string& name,
|
||||||
const std::string& type,
|
const std::string& type,
|
||||||
bool include_nested_pools) const override;
|
bool include_nested_pools) const override;
|
||||||
|
@@ -158,10 +158,10 @@ class NET_EXPORT ClientSocketPool : public LowerLayeredPool {
|
|||||||
const ClientSocketHandle* handle) const = 0;
|
const ClientSocketHandle* handle) const = 0;
|
||||||
|
|
||||||
// Retrieves information on the current state of the pool as a
|
// Retrieves information on the current state of the pool as a
|
||||||
// DictionaryValue. Caller takes possession of the returned value.
|
// DictionaryValue.
|
||||||
// If |include_nested_pools| is true, the states of any nested
|
// If |include_nested_pools| is true, the states of any nested
|
||||||
// ClientSocketPools will be included.
|
// ClientSocketPools will be included.
|
||||||
virtual base::DictionaryValue* GetInfoAsValue(
|
virtual scoped_ptr<base::DictionaryValue> GetInfoAsValue(
|
||||||
const std::string& name,
|
const std::string& name,
|
||||||
const std::string& type,
|
const std::string& type,
|
||||||
bool include_nested_pools) const = 0;
|
bool include_nested_pools) const = 0;
|
||||||
|
@@ -595,7 +595,7 @@ LoadState ClientSocketPoolBaseHelper::GetLoadState(
|
|||||||
return LOAD_STATE_WAITING_FOR_AVAILABLE_SOCKET;
|
return LOAD_STATE_WAITING_FOR_AVAILABLE_SOCKET;
|
||||||
}
|
}
|
||||||
|
|
||||||
base::DictionaryValue* ClientSocketPoolBaseHelper::GetInfoAsValue(
|
scoped_ptr<base::DictionaryValue> ClientSocketPoolBaseHelper::GetInfoAsValue(
|
||||||
const std::string& name, const std::string& type) const {
|
const std::string& name, const std::string& type) const {
|
||||||
scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
|
scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
|
||||||
dict->SetString("name", name);
|
dict->SetString("name", name);
|
||||||
@@ -608,7 +608,7 @@ base::DictionaryValue* ClientSocketPoolBaseHelper::GetInfoAsValue(
|
|||||||
dict->SetInteger("pool_generation_number", pool_generation_number_);
|
dict->SetInteger("pool_generation_number", pool_generation_number_);
|
||||||
|
|
||||||
if (group_map_.empty())
|
if (group_map_.empty())
|
||||||
return dict.release();
|
return dict.Pass();
|
||||||
|
|
||||||
base::DictionaryValue* all_groups_dict = new base::DictionaryValue();
|
base::DictionaryValue* all_groups_dict = new base::DictionaryValue();
|
||||||
for (GroupMap::const_iterator it = group_map_.begin();
|
for (GroupMap::const_iterator it = group_map_.begin();
|
||||||
@@ -652,7 +652,7 @@ base::DictionaryValue* ClientSocketPoolBaseHelper::GetInfoAsValue(
|
|||||||
all_groups_dict->SetWithoutPathExpansion(it->first, group_dict);
|
all_groups_dict->SetWithoutPathExpansion(it->first, group_dict);
|
||||||
}
|
}
|
||||||
dict->Set("groups", all_groups_dict);
|
dict->Set("groups", all_groups_dict);
|
||||||
return dict.release();
|
return dict.Pass();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ClientSocketPoolBaseHelper::IdleSocket::IsUsable() const {
|
bool ClientSocketPoolBaseHelper::IdleSocket::IsUsable() const {
|
||||||
|
@@ -326,8 +326,9 @@ class NET_EXPORT_PRIVATE ClientSocketPoolBaseHelper
|
|||||||
bool CloseOneIdleConnectionInHigherLayeredPool();
|
bool CloseOneIdleConnectionInHigherLayeredPool();
|
||||||
|
|
||||||
// See ClientSocketPool::GetInfoAsValue for documentation on this function.
|
// See ClientSocketPool::GetInfoAsValue for documentation on this function.
|
||||||
base::DictionaryValue* GetInfoAsValue(const std::string& name,
|
scoped_ptr<base::DictionaryValue> GetInfoAsValue(
|
||||||
const std::string& type) const;
|
const std::string& name,
|
||||||
|
const std::string& type) const;
|
||||||
|
|
||||||
base::TimeDelta ConnectionTimeout() const {
|
base::TimeDelta ConnectionTimeout() const {
|
||||||
return connect_job_factory_->ConnectionTimeout();
|
return connect_job_factory_->ConnectionTimeout();
|
||||||
@@ -827,7 +828,7 @@ class ClientSocketPoolBase {
|
|||||||
return helper_.CleanupIdleSockets(force);
|
return helper_.CleanupIdleSockets(force);
|
||||||
}
|
}
|
||||||
|
|
||||||
base::DictionaryValue* GetInfoAsValue(const std::string& name,
|
scoped_ptr<base::DictionaryValue> GetInfoAsValue(const std::string& name,
|
||||||
const std::string& type) const {
|
const std::string& type) const {
|
||||||
return helper_.GetInfoAsValue(name, type);
|
return helper_.GetInfoAsValue(name, type);
|
||||||
}
|
}
|
||||||
|
@@ -558,7 +558,7 @@ class TestClientSocketPool : public ClientSocketPool {
|
|||||||
base_.RemoveHigherLayeredPool(higher_pool);
|
base_.RemoveHigherLayeredPool(higher_pool);
|
||||||
}
|
}
|
||||||
|
|
||||||
base::DictionaryValue* GetInfoAsValue(
|
scoped_ptr<base::DictionaryValue> GetInfoAsValue(
|
||||||
const std::string& name,
|
const std::string& name,
|
||||||
const std::string& type,
|
const std::string& type,
|
||||||
bool include_nested_pools) const override {
|
bool include_nested_pools) const override {
|
||||||
|
@@ -266,11 +266,11 @@ LoadState SOCKSClientSocketPool::GetLoadState(
|
|||||||
return base_.GetLoadState(group_name, handle);
|
return base_.GetLoadState(group_name, handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
base::DictionaryValue* SOCKSClientSocketPool::GetInfoAsValue(
|
scoped_ptr<base::DictionaryValue> SOCKSClientSocketPool::GetInfoAsValue(
|
||||||
const std::string& name,
|
const std::string& name,
|
||||||
const std::string& type,
|
const std::string& type,
|
||||||
bool include_nested_pools) const {
|
bool include_nested_pools) const {
|
||||||
base::DictionaryValue* dict = base_.GetInfoAsValue(name, type);
|
scoped_ptr<base::DictionaryValue> dict(base_.GetInfoAsValue(name, type));
|
||||||
if (include_nested_pools) {
|
if (include_nested_pools) {
|
||||||
scoped_ptr<base::ListValue> list(new base::ListValue());
|
scoped_ptr<base::ListValue> list(new base::ListValue());
|
||||||
list->Append(transport_pool_->GetInfoAsValue("transport_socket_pool",
|
list->Append(transport_pool_->GetInfoAsValue("transport_socket_pool",
|
||||||
@@ -278,7 +278,7 @@ base::DictionaryValue* SOCKSClientSocketPool::GetInfoAsValue(
|
|||||||
false));
|
false));
|
||||||
dict->Set("nested_pools", list.Pass());
|
dict->Set("nested_pools", list.Pass());
|
||||||
}
|
}
|
||||||
return dict;
|
return dict.Pass();
|
||||||
}
|
}
|
||||||
|
|
||||||
base::TimeDelta SOCKSClientSocketPool::ConnectionTimeout() const {
|
base::TimeDelta SOCKSClientSocketPool::ConnectionTimeout() const {
|
||||||
|
@@ -148,7 +148,7 @@ class NET_EXPORT_PRIVATE SOCKSClientSocketPool
|
|||||||
LoadState GetLoadState(const std::string& group_name,
|
LoadState GetLoadState(const std::string& group_name,
|
||||||
const ClientSocketHandle* handle) const override;
|
const ClientSocketHandle* handle) const override;
|
||||||
|
|
||||||
base::DictionaryValue* GetInfoAsValue(
|
scoped_ptr<base::DictionaryValue> GetInfoAsValue(
|
||||||
const std::string& name,
|
const std::string& name,
|
||||||
const std::string& type,
|
const std::string& type,
|
||||||
bool include_nested_pools) const override;
|
bool include_nested_pools) const override;
|
||||||
|
@@ -617,11 +617,11 @@ LoadState SSLClientSocketPool::GetLoadState(
|
|||||||
return base_.GetLoadState(group_name, handle);
|
return base_.GetLoadState(group_name, handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
base::DictionaryValue* SSLClientSocketPool::GetInfoAsValue(
|
scoped_ptr<base::DictionaryValue> SSLClientSocketPool::GetInfoAsValue(
|
||||||
const std::string& name,
|
const std::string& name,
|
||||||
const std::string& type,
|
const std::string& type,
|
||||||
bool include_nested_pools) const {
|
bool include_nested_pools) const {
|
||||||
base::DictionaryValue* dict = base_.GetInfoAsValue(name, type);
|
scoped_ptr<base::DictionaryValue> dict(base_.GetInfoAsValue(name, type));
|
||||||
if (include_nested_pools) {
|
if (include_nested_pools) {
|
||||||
base::ListValue* list = new base::ListValue();
|
base::ListValue* list = new base::ListValue();
|
||||||
if (transport_pool_) {
|
if (transport_pool_) {
|
||||||
@@ -641,7 +641,7 @@ base::DictionaryValue* SSLClientSocketPool::GetInfoAsValue(
|
|||||||
}
|
}
|
||||||
dict->Set("nested_pools", list);
|
dict->Set("nested_pools", list);
|
||||||
}
|
}
|
||||||
return dict;
|
return dict.Pass();
|
||||||
}
|
}
|
||||||
|
|
||||||
base::TimeDelta SSLClientSocketPool::ConnectionTimeout() const {
|
base::TimeDelta SSLClientSocketPool::ConnectionTimeout() const {
|
||||||
|
@@ -232,7 +232,7 @@ class NET_EXPORT_PRIVATE SSLClientSocketPool
|
|||||||
LoadState GetLoadState(const std::string& group_name,
|
LoadState GetLoadState(const std::string& group_name,
|
||||||
const ClientSocketHandle* handle) const override;
|
const ClientSocketHandle* handle) const override;
|
||||||
|
|
||||||
base::DictionaryValue* GetInfoAsValue(
|
scoped_ptr<base::DictionaryValue> GetInfoAsValue(
|
||||||
const std::string& name,
|
const std::string& name,
|
||||||
const std::string& type,
|
const std::string& type,
|
||||||
bool include_nested_pools) const override;
|
bool include_nested_pools) const override;
|
||||||
|
@@ -609,7 +609,7 @@ LoadState TransportClientSocketPool::GetLoadState(
|
|||||||
return base_.GetLoadState(group_name, handle);
|
return base_.GetLoadState(group_name, handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
base::DictionaryValue* TransportClientSocketPool::GetInfoAsValue(
|
scoped_ptr<base::DictionaryValue> TransportClientSocketPool::GetInfoAsValue(
|
||||||
const std::string& name,
|
const std::string& name,
|
||||||
const std::string& type,
|
const std::string& type,
|
||||||
bool include_nested_pools) const {
|
bool include_nested_pools) const {
|
||||||
|
@@ -259,7 +259,7 @@ class NET_EXPORT_PRIVATE TransportClientSocketPool : public ClientSocketPool {
|
|||||||
int IdleSocketCountInGroup(const std::string& group_name) const override;
|
int IdleSocketCountInGroup(const std::string& group_name) const override;
|
||||||
LoadState GetLoadState(const std::string& group_name,
|
LoadState GetLoadState(const std::string& group_name,
|
||||||
const ClientSocketHandle* handle) const override;
|
const ClientSocketHandle* handle) const override;
|
||||||
base::DictionaryValue* GetInfoAsValue(
|
scoped_ptr<base::DictionaryValue> GetInfoAsValue(
|
||||||
const std::string& name,
|
const std::string& name,
|
||||||
const std::string& type,
|
const std::string& type,
|
||||||
bool include_nested_pools) const override;
|
bool include_nested_pools) const override;
|
||||||
|
@@ -432,10 +432,11 @@ LoadState WebSocketTransportClientSocketPool::GetLoadState(
|
|||||||
return LookupConnectJob(handle)->GetLoadState();
|
return LookupConnectJob(handle)->GetLoadState();
|
||||||
}
|
}
|
||||||
|
|
||||||
base::DictionaryValue* WebSocketTransportClientSocketPool::GetInfoAsValue(
|
scoped_ptr<base::DictionaryValue>
|
||||||
const std::string& name,
|
WebSocketTransportClientSocketPool::GetInfoAsValue(
|
||||||
const std::string& type,
|
const std::string& name,
|
||||||
bool include_nested_pools) const {
|
const std::string& type,
|
||||||
|
bool include_nested_pools) const {
|
||||||
scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
|
scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
|
||||||
dict->SetString("name", name);
|
dict->SetString("name", name);
|
||||||
dict->SetString("type", type);
|
dict->SetString("type", type);
|
||||||
@@ -445,7 +446,7 @@ base::DictionaryValue* WebSocketTransportClientSocketPool::GetInfoAsValue(
|
|||||||
dict->SetInteger("max_socket_count", max_sockets_);
|
dict->SetInteger("max_socket_count", max_sockets_);
|
||||||
dict->SetInteger("max_sockets_per_group", max_sockets_);
|
dict->SetInteger("max_sockets_per_group", max_sockets_);
|
||||||
dict->SetInteger("pool_generation_number", 0);
|
dict->SetInteger("pool_generation_number", 0);
|
||||||
return dict.release();
|
return dict.Pass();
|
||||||
}
|
}
|
||||||
|
|
||||||
TimeDelta WebSocketTransportClientSocketPool::ConnectionTimeout() const {
|
TimeDelta WebSocketTransportClientSocketPool::ConnectionTimeout() const {
|
||||||
|
@@ -152,7 +152,7 @@ class NET_EXPORT_PRIVATE WebSocketTransportClientSocketPool
|
|||||||
int IdleSocketCountInGroup(const std::string& group_name) const override;
|
int IdleSocketCountInGroup(const std::string& group_name) const override;
|
||||||
LoadState GetLoadState(const std::string& group_name,
|
LoadState GetLoadState(const std::string& group_name,
|
||||||
const ClientSocketHandle* handle) const override;
|
const ClientSocketHandle* handle) const override;
|
||||||
base::DictionaryValue* GetInfoAsValue(
|
scoped_ptr<base::DictionaryValue> GetInfoAsValue(
|
||||||
const std::string& name,
|
const std::string& name,
|
||||||
const std::string& type,
|
const std::string& type,
|
||||||
bool include_nested_pools) const override;
|
bool include_nested_pools) const override;
|
||||||
|
Reference in New Issue
Block a user