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

Unified Diff: net/http/http_cache.cc

Issue 2996006: Http Cache: Enable some checks to track a low volume crash.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_cache.cc
===================================================================
--- net/http/http_cache.cc (revision 52334)
+++ net/http/http_cache.cc (working copy)
@@ -51,8 +51,10 @@
}
HttpCache::ActiveEntry::~ActiveEntry() {
- if (disk_entry)
+ if (disk_entry) {
disk_entry->Close();
+ disk_entry = NULL;
+ }
}
//-----------------------------------------------------------------------------
@@ -94,6 +96,8 @@
// 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_)
@@ -531,19 +535,21 @@
}
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;
@@ -662,7 +668,9 @@
}
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
@@ -869,7 +877,8 @@
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()) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698