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

Unified Diff: webrtc/base/diskcache.cc

Issue 2620303003: Replace ASSERT by RTC_DCHECK in all non-test code. (Closed)
Patch Set: Address final nits. Created 3 years, 11 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 | « webrtc/base/asyncudpsocket.cc ('k') | webrtc/base/httpbase.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/diskcache.cc
diff --git a/webrtc/base/diskcache.cc b/webrtc/base/diskcache.cc
index 207a1afa1bf73d0dfc875ae25dd324e88172d01e..20b8bf68cc14a30d5aec374c5e17a7ac6c21d6aa 100644
--- a/webrtc/base/diskcache.cc
+++ b/webrtc/base/diskcache.cc
@@ -66,7 +66,7 @@ DiskCache::DiskCache() : max_cache_(0), total_size_(0), total_accessors_(0) {
}
DiskCache::~DiskCache() {
- ASSERT(0 == total_accessors_);
+ RTC_DCHECK(0 == total_accessors_);
}
bool DiskCache::Initialize(const std::string& folder, size_t size) {
@@ -75,7 +75,7 @@ bool DiskCache::Initialize(const std::string& folder, size_t size) {
folder_ = folder;
max_cache_ = size;
- ASSERT(0 == total_size_);
+ RTC_DCHECK(0 == total_size_);
if (!InitializeEntries())
return false;
@@ -121,7 +121,7 @@ StreamInterface* DiskCache::WriteResource(const std::string& id, size_t index) {
size_t previous_size = 0;
std::string filename(IdToFilename(id, index));
FileStream::GetSize(filename, &previous_size);
- ASSERT(previous_size <= entry->size);
+ RTC_DCHECK(previous_size <= entry->size);
if (previous_size > entry->size) {
previous_size = entry->size;
}
@@ -221,7 +221,7 @@ bool DiskCache::CheckLimit() {
for (EntryMap::iterator it = map_.begin(); it != map_.end(); ++it) {
cache_size += it->second.size;
}
- ASSERT(cache_size == total_size_);
+ RTC_DCHECK(cache_size == total_size_);
#endif
// TODO: Replace this with a non-brain-dead algorithm for clearing out the
@@ -259,7 +259,7 @@ std::string DiskCache::IdToFilename(const std::string& id, size_t index) const {
char* buffer = new char[buffer_size];
encode(buffer, buffer_size, id.data(), id.length(),
unsafe_filename_characters(), '%');
- // TODO: ASSERT(strlen(buffer) < FileSystem::MaxBasenameLength());
+ // TODO(nisse): RTC_DCHECK(strlen(buffer) < FileSystem::MaxBasenameLength());
#else // !TRANSPARENT_CACHE_NAMES
// We might want to just use a hash of the filename at some point, both for
// obfuscation, and to avoid both filename length and escaping issues.
« no previous file with comments | « webrtc/base/asyncudpsocket.cc ('k') | webrtc/base/httpbase.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698