0

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:
ketan.goyal
2015-06-03 03:53:36 -07:00
committed by Commit bot
parent 98b51d8ead
commit f84eda918f
15 changed files with 32 additions and 29 deletions

@ -296,6 +296,7 @@ Kaustubh Atrawalkar <kaustubh.a@samsung.com>
Keene Pan <keenepan@linpus.com>
Kenneth Rohde Christiansen <kenneth.r.christiansen@intel.com>
Keonho Kim <keonho07.kim@samsung.com>
Ketan Goyal <ketan.goyal@samsung.com>
Kevin Lee Helpingstine <sig11@reprehensible.net>
Kevin M. McCormick <mckev@amazon.com>
Kihong Kwon <kihong.kwon@samsung.com>

@ -511,11 +511,11 @@ LoadState HttpProxyClientSocketPool::GetLoadState(
return base_.GetLoadState(group_name, handle);
}
base::DictionaryValue* HttpProxyClientSocketPool::GetInfoAsValue(
scoped_ptr<base::DictionaryValue> HttpProxyClientSocketPool::GetInfoAsValue(
const std::string& name,
const std::string& type,
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) {
base::ListValue* list = new base::ListValue();
if (transport_pool_) {
@ -530,7 +530,7 @@ base::DictionaryValue* HttpProxyClientSocketPool::GetInfoAsValue(
}
dict->Set("nested_pools", list);
}
return dict;
return dict.Pass();
}
base::TimeDelta HttpProxyClientSocketPool::ConnectionTimeout() const {

@ -221,7 +221,7 @@ class NET_EXPORT_PRIVATE HttpProxyClientSocketPool
LoadState GetLoadState(const std::string& group_name,
const ClientSocketHandle* handle) const override;
base::DictionaryValue* GetInfoAsValue(
scoped_ptr<base::DictionaryValue> GetInfoAsValue(
const std::string& name,
const std::string& type,
bool include_nested_pools) const override;

@ -158,10 +158,10 @@ class NET_EXPORT ClientSocketPool : public LowerLayeredPool {
const ClientSocketHandle* handle) const = 0;
// 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
// ClientSocketPools will be included.
virtual base::DictionaryValue* GetInfoAsValue(
virtual scoped_ptr<base::DictionaryValue> GetInfoAsValue(
const std::string& name,
const std::string& type,
bool include_nested_pools) const = 0;

@ -595,7 +595,7 @@ LoadState ClientSocketPoolBaseHelper::GetLoadState(
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 {
scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
dict->SetString("name", name);
@ -608,7 +608,7 @@ base::DictionaryValue* ClientSocketPoolBaseHelper::GetInfoAsValue(
dict->SetInteger("pool_generation_number", pool_generation_number_);
if (group_map_.empty())
return dict.release();
return dict.Pass();
base::DictionaryValue* all_groups_dict = new base::DictionaryValue();
for (GroupMap::const_iterator it = group_map_.begin();
@ -652,7 +652,7 @@ base::DictionaryValue* ClientSocketPoolBaseHelper::GetInfoAsValue(
all_groups_dict->SetWithoutPathExpansion(it->first, group_dict);
}
dict->Set("groups", all_groups_dict);
return dict.release();
return dict.Pass();
}
bool ClientSocketPoolBaseHelper::IdleSocket::IsUsable() const {

@ -326,8 +326,9 @@ class NET_EXPORT_PRIVATE ClientSocketPoolBaseHelper
bool CloseOneIdleConnectionInHigherLayeredPool();
// See ClientSocketPool::GetInfoAsValue for documentation on this function.
base::DictionaryValue* GetInfoAsValue(const std::string& name,
const std::string& type) const;
scoped_ptr<base::DictionaryValue> GetInfoAsValue(
const std::string& name,
const std::string& type) const;
base::TimeDelta ConnectionTimeout() const {
return connect_job_factory_->ConnectionTimeout();
@ -827,7 +828,7 @@ class ClientSocketPoolBase {
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 {
return helper_.GetInfoAsValue(name, type);
}

@ -558,7 +558,7 @@ class TestClientSocketPool : public ClientSocketPool {
base_.RemoveHigherLayeredPool(higher_pool);
}
base::DictionaryValue* GetInfoAsValue(
scoped_ptr<base::DictionaryValue> GetInfoAsValue(
const std::string& name,
const std::string& type,
bool include_nested_pools) const override {

@ -266,11 +266,11 @@ LoadState SOCKSClientSocketPool::GetLoadState(
return base_.GetLoadState(group_name, handle);
}
base::DictionaryValue* SOCKSClientSocketPool::GetInfoAsValue(
scoped_ptr<base::DictionaryValue> SOCKSClientSocketPool::GetInfoAsValue(
const std::string& name,
const std::string& type,
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) {
scoped_ptr<base::ListValue> list(new base::ListValue());
list->Append(transport_pool_->GetInfoAsValue("transport_socket_pool",
@ -278,7 +278,7 @@ base::DictionaryValue* SOCKSClientSocketPool::GetInfoAsValue(
false));
dict->Set("nested_pools", list.Pass());
}
return dict;
return dict.Pass();
}
base::TimeDelta SOCKSClientSocketPool::ConnectionTimeout() const {

@ -148,7 +148,7 @@ class NET_EXPORT_PRIVATE SOCKSClientSocketPool
LoadState GetLoadState(const std::string& group_name,
const ClientSocketHandle* handle) const override;
base::DictionaryValue* GetInfoAsValue(
scoped_ptr<base::DictionaryValue> GetInfoAsValue(
const std::string& name,
const std::string& type,
bool include_nested_pools) const override;

@ -617,11 +617,11 @@ LoadState SSLClientSocketPool::GetLoadState(
return base_.GetLoadState(group_name, handle);
}
base::DictionaryValue* SSLClientSocketPool::GetInfoAsValue(
scoped_ptr<base::DictionaryValue> SSLClientSocketPool::GetInfoAsValue(
const std::string& name,
const std::string& type,
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) {
base::ListValue* list = new base::ListValue();
if (transport_pool_) {
@ -641,7 +641,7 @@ base::DictionaryValue* SSLClientSocketPool::GetInfoAsValue(
}
dict->Set("nested_pools", list);
}
return dict;
return dict.Pass();
}
base::TimeDelta SSLClientSocketPool::ConnectionTimeout() const {

@ -232,7 +232,7 @@ class NET_EXPORT_PRIVATE SSLClientSocketPool
LoadState GetLoadState(const std::string& group_name,
const ClientSocketHandle* handle) const override;
base::DictionaryValue* GetInfoAsValue(
scoped_ptr<base::DictionaryValue> GetInfoAsValue(
const std::string& name,
const std::string& type,
bool include_nested_pools) const override;

@ -609,7 +609,7 @@ LoadState TransportClientSocketPool::GetLoadState(
return base_.GetLoadState(group_name, handle);
}
base::DictionaryValue* TransportClientSocketPool::GetInfoAsValue(
scoped_ptr<base::DictionaryValue> TransportClientSocketPool::GetInfoAsValue(
const std::string& name,
const std::string& type,
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;
LoadState GetLoadState(const std::string& group_name,
const ClientSocketHandle* handle) const override;
base::DictionaryValue* GetInfoAsValue(
scoped_ptr<base::DictionaryValue> GetInfoAsValue(
const std::string& name,
const std::string& type,
bool include_nested_pools) const override;

@ -432,10 +432,11 @@ LoadState WebSocketTransportClientSocketPool::GetLoadState(
return LookupConnectJob(handle)->GetLoadState();
}
base::DictionaryValue* WebSocketTransportClientSocketPool::GetInfoAsValue(
const std::string& name,
const std::string& type,
bool include_nested_pools) const {
scoped_ptr<base::DictionaryValue>
WebSocketTransportClientSocketPool::GetInfoAsValue(
const std::string& name,
const std::string& type,
bool include_nested_pools) const {
scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
dict->SetString("name", name);
dict->SetString("type", type);
@ -445,7 +446,7 @@ base::DictionaryValue* WebSocketTransportClientSocketPool::GetInfoAsValue(
dict->SetInteger("max_socket_count", max_sockets_);
dict->SetInteger("max_sockets_per_group", max_sockets_);
dict->SetInteger("pool_generation_number", 0);
return dict.release();
return dict.Pass();
}
TimeDelta WebSocketTransportClientSocketPool::ConnectionTimeout() const {

@ -152,7 +152,7 @@ class NET_EXPORT_PRIVATE WebSocketTransportClientSocketPool
int IdleSocketCountInGroup(const std::string& group_name) const override;
LoadState GetLoadState(const std::string& group_name,
const ClientSocketHandle* handle) const override;
base::DictionaryValue* GetInfoAsValue(
scoped_ptr<base::DictionaryValue> GetInfoAsValue(
const std::string& name,
const std::string& type,
bool include_nested_pools) const override;