summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-18 23:22:33 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-18 23:22:33 +0000
commit9b2dda1d525555d236ebaff7cf6f658937383549 (patch)
tree9c92a3f82a874e0bcac459de4abcaaaca4d12f12
parent86cbe78d10026df1273c3939d967c6d1faeb82dd (diff)
downloadchromium_src-9b2dda1d525555d236ebaff7cf6f658937383549.zip
chromium_src-9b2dda1d525555d236ebaff7cf6f658937383549.tar.gz
chromium_src-9b2dda1d525555d236ebaff7cf6f658937383549.tar.bz2
Disk cache: A few minor fixes to make coverity happy.
Review URL: http://codereview.chromium.org/48155 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12028 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--net/disk_cache/backend_unittest.cc4
-rw-r--r--net/disk_cache/entry_impl.cc2
-rw-r--r--net/disk_cache/file_win.cc4
-rw-r--r--net/disk_cache/mem_entry_impl.cc2
4 files changed, 8 insertions, 4 deletions
diff --git a/net/disk_cache/backend_unittest.cc b/net/disk_cache/backend_unittest.cc
index 4b61133..63d5a28 100644
--- a/net/disk_cache/backend_unittest.cc
+++ b/net/disk_cache/backend_unittest.cc
@@ -507,10 +507,10 @@ void DiskCacheBackendTest::BackendEnumerations() {
if (count < kNumEntries) {
last_modified[count] = entry->GetLastModified();
last_used[count] = entry->GetLastUsed();
+ EXPECT_TRUE(initial <= last_modified[count]);
+ EXPECT_TRUE(final >= last_modified[count]);
}
- EXPECT_TRUE(initial <= last_modified[count]);
- EXPECT_TRUE(final >= last_modified[count]);
entry->Close();
count++;
};
diff --git a/net/disk_cache/entry_impl.cc b/net/disk_cache/entry_impl.cc
index 2e852a4..d82cb48 100644
--- a/net/disk_cache/entry_impl.cc
+++ b/net/disk_cache/entry_impl.cc
@@ -579,9 +579,9 @@ void EntryImpl::SetTimes(base::Time last_used, base::Time last_modified) {
}
bool EntryImpl::CreateDataBlock(int index, int size) {
- Addr address(entry_.Data()->data_addr[index]);
DCHECK(index >= 0 && index < NUM_STREAMS);
+ Addr address(entry_.Data()->data_addr[index]);
if (!CreateBlock(size, &address))
return false;
diff --git a/net/disk_cache/file_win.cc b/net/disk_cache/file_win.cc
index ce4a602..d5a85e1 100644
--- a/net/disk_cache/file_win.cc
+++ b/net/disk_cache/file_win.cc
@@ -62,7 +62,9 @@ MyOverlapped::MyOverlapped(disk_cache::File* file, size_t offset,
MyOverlapped::~MyOverlapped() {
if (delete_buffer_) {
DCHECK(!callback_);
- delete buffer_;
+ // This whole thing could be updated to use IOBuffer, but PostWrite is not
+ // used at the moment. TODO(rvargas): remove or update this code.
+ delete[] reinterpret_cast<const char*>(buffer_);
}
}
diff --git a/net/disk_cache/mem_entry_impl.cc b/net/disk_cache/mem_entry_impl.cc
index 77e1b32..9b8c1c9 100644
--- a/net/disk_cache/mem_entry_impl.cc
+++ b/net/disk_cache/mem_entry_impl.cc
@@ -17,6 +17,8 @@ MemEntryImpl::MemEntryImpl(MemBackendImpl* backend) {
doomed_ = false;
backend_ = backend;
ref_count_ = 0;
+ next_ = NULL;
+ prev_ = NULL;
for (int i = 0; i < NUM_STREAMS; i++)
data_size_[i] = 0;
}