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

Unified Diff: net/base/sdch_manager.cc

Issue 1146413002: Converted bare pointers to scoped_ptr in net/base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed Created 5 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/sdch_manager.cc
diff --git a/net/base/sdch_manager.cc b/net/base/sdch_manager.cc
index dbfdf5de31ee46099669d61f09c50ff53270592c..b5d07ea08f4e5274d5c286f1e6a7b7ba12edb0a7 100644
--- a/net/base/sdch_manager.cc
+++ b/net/base/sdch_manager.cc
@@ -490,45 +490,45 @@ void SdchManager::UrlSafeBase64Encode(const std::string& input,
}
base::Value* SdchManager::SdchInfoToValue() const {
- base::DictionaryValue* value = new base::DictionaryValue();
+ scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
value->SetBoolean("sdch_enabled", sdch_enabled());
value->SetBoolean("secure_scheme_support", secure_scheme_supported());
- base::ListValue* entry_list = new base::ListValue();
+ scoped_ptr<base::ListValue> entry_list(new base::ListValue());
for (const auto& entry: dictionaries_) {
- base::DictionaryValue* entry_dict = new base::DictionaryValue();
+ scoped_ptr<base::DictionaryValue> entry_dict(new base::DictionaryValue());
entry_dict->SetString("url", entry.second->data.url().spec());
entry_dict->SetString("client_hash", entry.second->data.client_hash());
entry_dict->SetString("domain", entry.second->data.domain());
entry_dict->SetString("path", entry.second->data.path());
- base::ListValue* port_list = new base::ListValue();
+ scoped_ptr<base::ListValue> port_list(new base::ListValue());
for (std::set<int>::const_iterator port_it =
entry.second->data.ports().begin();
port_it != entry.second->data.ports().end(); ++port_it) {
port_list->AppendInteger(*port_it);
}
- entry_dict->Set("ports", port_list);
+ entry_dict->Set("ports", port_list.Pass());
entry_dict->SetString("server_hash", entry.first);
- entry_list->Append(entry_dict);
+ entry_list->Append(entry_dict.Pass());
}
- value->Set("dictionaries", entry_list);
+ value->Set("dictionaries", entry_list.Pass());
- entry_list = new base::ListValue();
+ entry_list.reset(new base::ListValue());
for (DomainBlacklistInfo::const_iterator it = blacklisted_domains_.begin();
it != blacklisted_domains_.end(); ++it) {
if (it->second.count == 0)
continue;
- base::DictionaryValue* entry_dict = new base::DictionaryValue();
+ scoped_ptr<base::DictionaryValue> entry_dict(new base::DictionaryValue());
entry_dict->SetString("domain", it->first);
if (it->second.count != INT_MAX)
entry_dict->SetInteger("tries", it->second.count);
entry_dict->SetInteger("reason", it->second.reason);
- entry_list->Append(entry_dict);
+ entry_list->Append(entry_dict.Pass());
}
- value->Set("blacklisted", entry_list);
+ value->Set("blacklisted", entry_list.Pass());
- return value;
+ return value.release();
}
} // namespace net
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698