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

Unified Diff: net/disk_cache/storage_block-inl.h

Issue 155951: Disk cache: Fix handling of invalid entries that are detected... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 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 | « net/disk_cache/storage_block.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/storage_block-inl.h
===================================================================
--- net/disk_cache/storage_block-inl.h (revision 21084)
+++ net/disk_cache/storage_block-inl.h (working copy)
@@ -62,6 +62,20 @@
data_ = other;
}
+template<typename T> void StorageBlock<T>::Discard() {
+ if (!data_)
+ return;
+ if (!own_data_) {
+ NOTREACHED();
+ return;
+ }
+ DeleteData();
+ data_ = NULL;
+ modified_ = false;
+ own_data_ = false;
+ extended_ = false;
+}
+
template<typename T> void StorageBlock<T>::set_modified() {
DCHECK(data_);
modified_ = true;
@@ -97,7 +111,7 @@
}
template<typename T> bool StorageBlock<T>::Store() {
- if (file_) {
+ if (file_ && data_) {
if (file_->Store(this)) {
modified_ = false;
return true;
« no previous file with comments | « net/disk_cache/storage_block.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698