summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-29 18:25:26 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-29 18:25:26 +0000
commit84303d8c22c35de5522758bf9b4fab1df15da3d2 (patch)
tree27b841c63565b602d371d9e44be5e1cd3e62175e /net
parent748bfd9c6d88897e3345a9598b52be8e7bf0eaf9 (diff)
downloadchromium_src-84303d8c22c35de5522758bf9b4fab1df15da3d2.zip
chromium_src-84303d8c22c35de5522758bf9b4fab1df15da3d2.tar.gz
chromium_src-84303d8c22c35de5522758bf9b4fab1df15da3d2.tar.bz2
Http cache: dump the transaction and active entry key
to check that they are not the same. BUG=9952 TEST=none Review URL: http://codereview.chromium.org/159594 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21974 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/http/http_cache.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/net/http/http_cache.cc b/net/http/http_cache.cc
index a45c1ba..4c2c45d 100644
--- a/net/http/http_cache.cc
+++ b/net/http/http_cache.cc
@@ -1588,6 +1588,7 @@ HttpCache::ActiveEntry* HttpCache::ActivateEntry(
#if defined(OS_WIN)
#pragma optimize("", off)
+#pragma warning(disable:4748)
#endif
// Avoid optimizing local_entry out of the code.
void HttpCache::DeactivateEntry(ActiveEntry* entry) {
@@ -1597,16 +1598,20 @@ void HttpCache::DeactivateEntry(ActiveEntry* entry) {
size_t readers_size = local_entry.readers.size();
size_t pending_size = local_entry.pending_queue.size();
- ActiveEntriesMap::iterator it =
- active_entries_.find(entry->disk_entry->GetKey());
+ std::string key = entry->disk_entry->GetKey();
+ ActiveEntriesMap::iterator it = active_entries_.find(key);
if (it == active_entries_.end() || it->second != entry ||
local_entry.will_process_pending_queue || local_entry.doomed ||
local_entry.writer || readers_size || pending_size || deleted_) {
bool local_mem_flag = in_memory_cache_;
ActiveEntriesSet::iterator it2 = doomed_entries_.find(entry);
+ char local_key[64];
+ int key_length = key.size();
+ base::strlcpy(local_key, key.c_str(), sizeof(local_key));
CHECK(it2 == doomed_entries_.end());
CHECK(!deleted_);
CHECK(local_mem_flag);
+ CHECK(key_length);
CHECK(false);
}
@@ -1617,6 +1622,7 @@ void HttpCache::DeactivateEntry(ActiveEntry* entry) {
local_entry.disk_entry = NULL;
}
#if defined(OS_WIN)
+#pragma warning(default:4748)
#pragma optimize("", on)
#endif
@@ -1677,6 +1683,9 @@ void HttpCache::DoneWithEntry(ActiveEntry* entry, Transaction* trans) {
char local_transaction[sizeof(*trans)];
memcpy(local_transaction, trans, sizeof(*trans));
+ char local_key[64];
+ base::strlcpy(local_key, trans->key().c_str(), sizeof(local_key));
+
// Assume that this is not a successful write.
DoneWritingToEntry(entry, false);
} else {