diff options
author | kushi.p@gmail.com <kushi.p@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-11 12:06:57 +0000 |
---|---|---|
committer | kushi.p@gmail.com <kushi.p@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-11 12:06:57 +0000 |
commit | c34e9a7afa5eb386f22aa2480156b6bdec8597cd (patch) | |
tree | 3aed8b60fedf6f25e7a5bd0c02b3c075086e2cfd | |
parent | fd9d182f030af6a3e14b218d3be4680059f404aa (diff) | |
download | chromium_src-c34e9a7afa5eb386f22aa2480156b6bdec8597cd.zip chromium_src-c34e9a7afa5eb386f22aa2480156b6bdec8597cd.tar.gz chromium_src-c34e9a7afa5eb386f22aa2480156b6bdec8597cd.tar.bz2 |
Updating logging in src/net/disk_cache/. Using DCHECK_NE/EQ/GT/GE/LT/LE() where possible
BUG=58409
Review URL: http://codereview.chromium.org/6966001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84966 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | net/disk_cache/backend_impl.cc | 6 | ||||
-rw-r--r-- | net/disk_cache/block_files.cc | 8 | ||||
-rw-r--r-- | net/disk_cache/disk_cache_test_util.cc | 4 | ||||
-rw-r--r-- | net/disk_cache/eviction.cc | 6 | ||||
-rw-r--r-- | net/disk_cache/file_win.cc | 6 | ||||
-rw-r--r-- | net/disk_cache/mapped_file_posix.cc | 4 | ||||
-rw-r--r-- | net/disk_cache/mem_backend_impl.cc | 6 | ||||
-rw-r--r-- | net/disk_cache/mem_entry_impl.cc | 6 |
8 files changed, 23 insertions, 23 deletions
diff --git a/net/disk_cache/backend_impl.cc b/net/disk_cache/backend_impl.cc index 16e1a76..fc64f9bd 100644 --- a/net/disk_cache/backend_impl.cc +++ b/net/disk_cache/backend_impl.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -808,7 +808,7 @@ bool BackendImpl::SetMaxSize(int max_bytes) { } void BackendImpl::SetType(net::CacheType type) { - DCHECK(type != net::MEMORY_CACHE); + DCHECK_NE(net::MEMORY_CACHE, type); cache_type_ = type; } @@ -933,7 +933,7 @@ void BackendImpl::RemoveEntry(EntryImpl* entry) { if (!new_eviction_) return; - DCHECK(ENTRY_NORMAL != entry->entry()->Data()->state); + DCHECK_NE(ENTRY_NORMAL, entry->entry()->Data()->state); Trace("Remove entry 0x%p", entry); eviction_.OnDestroyEntry(entry); diff --git a/net/disk_cache/block_files.cc b/net/disk_cache/block_files.cc index faa9706..c9b5238 100644 --- a/net/disk_cache/block_files.cc +++ b/net/disk_cache/block_files.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -66,7 +66,7 @@ bool CreateMapBlock(int target, int size, disk_cache::BlockFileHeader* header, header->hints[target - 1] = current; header->empty[target - 1]--; - DCHECK(header->empty[target - 1] >= 0); + DCHECK_GE(header->empty[target - 1], 0); header->num_entries++; if (target != size) { header->empty[target - size - 1]++; @@ -115,10 +115,10 @@ void DeleteMapBlock(int index, int size, disk_cache::BlockFileHeader* header) { if (bits_at_end) header->empty[bits_at_end - 1]--; header->empty[new_type - 1]++; - DCHECK(header->empty[bits_at_end - 1] >= 0); + DCHECK_GE(header->empty[bits_at_end - 1], 0); } header->num_entries--; - DCHECK(header->num_entries >= 0); + DCHECK_GE(header->num_entries, 0); HISTOGRAM_TIMES("DiskCache.DeleteBlock", TimeTicks::Now() - start); } diff --git a/net/disk_cache/disk_cache_test_util.cc b/net/disk_cache/disk_cache_test_util.cc index ed16db0..4110f04 100644 --- a/net/disk_cache/disk_cache_test_util.cc +++ b/net/disk_cache/disk_cache_test_util.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -133,7 +133,7 @@ CallbackTest::~CallbackTest() {} // errors (an unexpected test received) void CallbackTest::RunWithParams(const Tuple1<int>& params) { if (reuse_) { - DCHECK(1 == reuse_); + DCHECK_EQ(1, reuse_); if (2 == reuse_) g_cache_tests_error = true; reuse_++; diff --git a/net/disk_cache/eviction.cc b/net/disk_cache/eviction.cc index ca26b4a..672ca61 100644 --- a/net/disk_cache/eviction.cc +++ b/net/disk_cache/eviction.cc @@ -266,7 +266,7 @@ bool Eviction::EvictEntry(CacheRankingsBlock* node, bool empty) { } else { entry->DeleteEntryData(false); EntryStore* info = entry->entry()->Data(); - DCHECK(ENTRY_NORMAL == info->state); + DCHECK_EQ(ENTRY_NORMAL, info->state); rankings_->Remove(entry->rankings(), GetListForEntryV2(entry)); info->state = ENTRY_EVICTED; @@ -368,7 +368,7 @@ void Eviction::UpdateRankV2(EntryImpl* entry, bool modified) { void Eviction::OnOpenEntryV2(EntryImpl* entry) { EntryStore* info = entry->entry()->Data(); - DCHECK(ENTRY_NORMAL == info->state); + DCHECK_EQ(ENTRY_NORMAL, info->state); if (info->reuse_count < kint32max) { info->reuse_count++; @@ -434,7 +434,7 @@ void Eviction::OnDestroyEntryV2(EntryImpl* entry) { Rankings::List Eviction::GetListForEntryV2(EntryImpl* entry) { EntryStore* info = entry->entry()->Data(); - DCHECK(ENTRY_NORMAL == info->state); + DCHECK_EQ(ENTRY_NORMAL, info->state); if (!info->reuse_count) return Rankings::NO_USE; diff --git a/net/disk_cache/file_win.cc b/net/disk_cache/file_win.cc index 737b8e8..9477604 100644 --- a/net/disk_cache/file_win.cc +++ b/net/disk_cache/file_win.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -182,7 +182,7 @@ bool File::Read(void* buffer, size_t buffer_len, size_t offset, // The operation completed already. We'll be called back anyway. *completed = (actual == size); - DCHECK(actual == size); + DCHECK_EQ(size, actual); data->callback_ = NULL; data->file_ = NULL; // There is no reason to hold on to this anymore. return *completed; @@ -222,7 +222,7 @@ bool File::AsyncWrite(const void* buffer, size_t buffer_len, size_t offset, // The operation completed already. We'll be called back anyway. *completed = (actual == size); - DCHECK(actual == size); + DCHECK_EQ(size, actual); data->callback_ = NULL; data->file_ = NULL; // There is no reason to hold on to this anymore. return *completed; diff --git a/net/disk_cache/mapped_file_posix.cc b/net/disk_cache/mapped_file_posix.cc index 9abfa5cd..ce9ae89 100644 --- a/net/disk_cache/mapped_file_posix.cc +++ b/net/disk_cache/mapped_file_posix.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -48,7 +48,7 @@ MappedFile::~MappedFile() { if (buffer_) { int ret = munmap(buffer_, view_size_); - DCHECK(0 == ret); + DCHECK_EQ(0, ret); } } diff --git a/net/disk_cache/mem_backend_impl.cc b/net/disk_cache/mem_backend_impl.cc index c2f0438..6915ede 100644 --- a/net/disk_cache/mem_backend_impl.cc +++ b/net/disk_cache/mem_backend_impl.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -306,7 +306,7 @@ void MemBackendImpl::TrimCache(bool empty) { void MemBackendImpl::AddStorageSize(int32 bytes) { current_size_ += bytes; - DCHECK(current_size_ >= 0); + DCHECK_GE(current_size_, 0); if (current_size_ > max_size_) TrimCache(false); @@ -314,7 +314,7 @@ void MemBackendImpl::AddStorageSize(int32 bytes) { void MemBackendImpl::SubstractStorageSize(int32 bytes) { current_size_ -= bytes; - DCHECK(current_size_ >= 0); + DCHECK_GE(current_size_, 0); } } // namespace disk_cache diff --git a/net/disk_cache/mem_entry_impl.cc b/net/disk_cache/mem_entry_impl.cc index 9df7306..f1267ce 100644 --- a/net/disk_cache/mem_entry_impl.cc +++ b/net/disk_cache/mem_entry_impl.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -107,7 +107,7 @@ void MemEntryImpl::Open() { // counting to child entry. DCHECK(type() == kParentEntry); ref_count_++; - DCHECK(ref_count_ >= 0); + DCHECK_GE(ref_count_, 0); DCHECK(!doomed_); } @@ -141,7 +141,7 @@ void MemEntryImpl::Close() { // Only a parent entry can be closed. DCHECK(type() == kParentEntry); ref_count_--; - DCHECK(ref_count_ >= 0); + DCHECK_GE(ref_count_, 0); if (!ref_count_ && doomed_) InternalDoom(); } |