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

Unified Diff: net/disk_cache/simple/simple_index_file.cc

Issue 16434016: Rewrite scoped_ptr<T>(NULL) to use the default ctor in net/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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/base/sdch_filter.cc ('k') | net/dns/dns_session.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/simple/simple_index_file.cc
diff --git a/net/disk_cache/simple/simple_index_file.cc b/net/disk_cache/simple/simple_index_file.cc
index 884522ed09f6ce50d5239f487fd2bb1590cf4ee8..6563cbfb3a2ea9fef543b43966e0a356023f0bad 100644
--- a/net/disk_cache/simple/simple_index_file.cc
+++ b/net/disk_cache/simple/simple_index_file.cc
@@ -173,7 +173,7 @@ scoped_ptr<SimpleIndex::EntrySet> SimpleIndexFile::LoadFromDisk(
std::string contents;
if(!file_util::ReadFileToString(index_filename, &contents)) {
LOG(WARNING) << "Could not read Simple Index file.";
- return scoped_ptr<SimpleIndex::EntrySet>(NULL);
+ return scoped_ptr<SimpleIndex::EntrySet>();
}
return SimpleIndexFile::Deserialize(contents.data(), contents.size());
@@ -186,7 +186,7 @@ scoped_ptr<SimpleIndex::EntrySet> SimpleIndexFile::Deserialize(const char* data,
Pickle pickle(data, data_len);
if (!pickle.data()) {
LOG(WARNING) << "Corrupt Simple Index File.";
- return scoped_ptr<SimpleIndex::EntrySet>(NULL);
+ return scoped_ptr<SimpleIndex::EntrySet>();
}
PickleIterator pickle_it(pickle);
@@ -198,18 +198,18 @@ scoped_ptr<SimpleIndex::EntrySet> SimpleIndexFile::Deserialize(const char* data,
if (crc_read != crc_calculated) {
LOG(WARNING) << "Invalid CRC in Simple Index file.";
- return scoped_ptr<SimpleIndex::EntrySet>(NULL);
+ return scoped_ptr<SimpleIndex::EntrySet>();
}
SimpleIndexFile::IndexMetadata index_metadata;
if (!index_metadata.Deserialize(&pickle_it)) {
LOG(ERROR) << "Invalid index_metadata on Simple Cache Index.";
- return scoped_ptr<SimpleIndex::EntrySet>(NULL);
+ return scoped_ptr<SimpleIndex::EntrySet>();
}
if (!index_metadata.CheckIndexMetadata()) {
LOG(ERROR) << "Invalid index_metadata on Simple Cache Index.";
- return scoped_ptr<SimpleIndex::EntrySet>(NULL);
+ return scoped_ptr<SimpleIndex::EntrySet>();
}
scoped_ptr<SimpleIndex::EntrySet> index_file_entries(
@@ -220,7 +220,7 @@ scoped_ptr<SimpleIndex::EntrySet> SimpleIndexFile::Deserialize(const char* data,
if (!pickle_it.ReadUInt64(&hash_key) ||
!entry_metadata.Deserialize(&pickle_it)) {
LOG(WARNING) << "Invalid EntryMetadata in Simple Index file.";
- return scoped_ptr<SimpleIndex::EntrySet>(NULL);
+ return scoped_ptr<SimpleIndex::EntrySet>();
}
SimpleIndex::InsertInEntrySet(
hash_key, entry_metadata, index_file_entries.get());
« no previous file with comments | « net/base/sdch_filter.cc ('k') | net/dns/dns_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698