summaryrefslogtreecommitdiffstats
path: root/net/http
diff options
context:
space:
mode:
authorrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-17 00:31:11 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-17 00:31:11 +0000
commit417250736e177c9782e0a3da564163ca076d2292 (patch)
treead9ae5425db736b7e8c690c35daf064297392456 /net/http
parent155f35e6495385739f54e457374cf7d00c741a22 (diff)
downloadchromium_src-417250736e177c9782e0a3da564163ca076d2292.zip
chromium_src-417250736e177c9782e0a3da564163ca076d2292.tar.gz
chromium_src-417250736e177c9782e0a3da564163ca076d2292.tar.bz2
Http Cache: Enable some checks to track a low volume crash.
BUG=47895 TEST=none Review URL: http://codereview.chromium.org/2996006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52779 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http')
-rw-r--r--net/http/http_cache.cc29
1 files changed, 19 insertions, 10 deletions
diff --git a/net/http/http_cache.cc b/net/http/http_cache.cc
index 552d9c4..dbd6bf1 100644
--- a/net/http/http_cache.cc
+++ b/net/http/http_cache.cc
@@ -51,8 +51,10 @@ HttpCache::ActiveEntry::ActiveEntry(disk_cache::Entry* e)
}
HttpCache::ActiveEntry::~ActiveEntry() {
- if (disk_entry)
+ if (disk_entry) {
disk_entry->Close();
+ disk_entry = NULL;
+ }
}
//-----------------------------------------------------------------------------
@@ -94,6 +96,8 @@ class HttpCache::WorkItem {
// Calls back the transaction with the result of the operation.
void NotifyTransaction(int result, ActiveEntry* entry) {
+ // TODO(rvargas): convert to DCHECK after fixing bug 47895.
+ CHECK(!entry || entry->disk_entry);
if (entry_)
*entry_ = entry;
if (trans_)
@@ -544,19 +548,21 @@ HttpCache::ActiveEntry* HttpCache::ActivateEntry(
}
void HttpCache::DeactivateEntry(ActiveEntry* entry) {
- DCHECK(!entry->will_process_pending_queue);
- DCHECK(!entry->doomed);
- DCHECK(!entry->writer);
- DCHECK(entry->readers.empty());
- DCHECK(entry->pending_queue.empty());
+ // TODO(rvargas): convert to DCHECKs after fixing bug 47895.
+ CHECK(!entry->will_process_pending_queue);
+ CHECK(!entry->doomed);
+ CHECK(!entry->writer);
+ CHECK(entry->disk_entry);
+ CHECK(entry->readers.empty());
+ CHECK(entry->pending_queue.empty());
std::string key = entry->disk_entry->GetKey();
if (key.empty())
return SlowDeactivateEntry(entry);
ActiveEntriesMap::iterator it = active_entries_.find(key);
- DCHECK(it != active_entries_.end());
- DCHECK(it->second == entry);
+ CHECK(it != active_entries_.end());
+ CHECK(it->second == entry);
active_entries_.erase(it);
delete entry;
@@ -675,7 +681,9 @@ void HttpCache::DestroyEntry(ActiveEntry* entry) {
}
int HttpCache::AddTransactionToEntry(ActiveEntry* entry, Transaction* trans) {
- DCHECK(entry);
+ // TODO(rvargas): convert to DCHECKs after fixing bug 47895.
+ CHECK(entry);
+ CHECK(entry->disk_entry);
// We implement a basic reader/writer lock for the disk cache entry. If
// there is already a writer, then everyone has to wait for the writer to
@@ -882,7 +890,8 @@ void HttpCache::ProcessPendingQueue(ActiveEntry* entry) {
void HttpCache::OnProcessPendingQueue(ActiveEntry* entry) {
entry->will_process_pending_queue = false;
- DCHECK(!entry->writer);
+ // TODO(rvargas): convert to DCHECK after fixing bug 47895.
+ CHECK(!entry->writer);
// If no one is interested in this entry, then we can de-activate it.
if (entry->pending_queue.empty()) {