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

Unified Diff: webrtc/base/diskcache.cc

Issue 2685783014: Replace NULL with nullptr in all C++ files. (Closed)
Patch Set: Fixing android. Created 3 years, 10 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
Index: webrtc/base/diskcache.cc
diff --git a/webrtc/base/diskcache.cc b/webrtc/base/diskcache.cc
index 2747018d17473547d2c3bab52884c336b865f999..a80aa457cd85491a95c09b70eebb1a12f3709ed6 100644
--- a/webrtc/base/diskcache.cc
+++ b/webrtc/base/diskcache.cc
@@ -111,7 +111,7 @@ bool DiskCache::LockResource(const std::string& id) {
StreamInterface* DiskCache::WriteResource(const std::string& id, size_t index) {
Entry* entry = GetOrCreateEntry(id, false);
if (LS_LOCKED != entry->lock_state)
- return NULL;
+ return nullptr;
size_t previous_size = 0;
std::string filename(IdToFilename(id, index));
@@ -122,9 +122,9 @@ StreamInterface* DiskCache::WriteResource(const std::string& id, size_t index) {
}
std::unique_ptr<FileStream> file(new FileStream);
- if (!file->Open(filename, "wb", NULL)) {
+ if (!file->Open(filename, "wb", nullptr)) {
LOG_F(LS_ERROR) << "Couldn't create cache file";
- return NULL;
+ return nullptr;
}
entry->streams = std::max(entry->streams, index + 1);
@@ -155,13 +155,13 @@ StreamInterface* DiskCache::ReadResource(const std::string& id,
size_t index) const {
const Entry* entry = GetEntry(id);
if (LS_UNLOCKED != entry->lock_state)
- return NULL;
+ return nullptr;
if (index >= entry->streams)
- return NULL;
+ return nullptr;
std::unique_ptr<FileStream> file(new FileStream);
- if (!file->Open(IdToFilename(id, index), "rb", NULL))
- return NULL;
+ if (!file->Open(IdToFilename(id, index), "rb", nullptr))
+ return nullptr;
entry->accessors += 1;
total_accessors_ += 1;
@@ -170,12 +170,12 @@ StreamInterface* DiskCache::ReadResource(const std::string& id,
bool DiskCache::HasResource(const std::string& id) const {
const Entry* entry = GetEntry(id);
- return (NULL != entry) && (entry->streams > 0);
+ return (nullptr != entry) && (entry->streams > 0);
}
bool DiskCache::HasResourceStream(const std::string& id, size_t index) const {
const Entry* entry = GetEntry(id);
- if ((NULL == entry) || (index >= entry->streams))
+ if ((nullptr == entry) || (index >= entry->streams))
return false;
std::string filename = IdToFilename(id, index);
@@ -300,7 +300,7 @@ DiskCache::Entry* DiskCache::GetOrCreateEntry(const std::string& id,
if (it != map_.end())
return &it->second;
if (!create)
- return NULL;
+ return nullptr;
Entry e;
e.lock_state = LS_UNLOCKED;
e.accessors = 0;

Powered by Google App Engine
This is Rietveld 408576698