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

Unified Diff: net/disk_cache/simple/simple_index_file.h

Issue 17265007: Unlink corrupt SimpleCache index files immediately after load. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rdsmith remediation Created 7 years, 6 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
Index: net/disk_cache/simple/simple_index_file.h
diff --git a/net/disk_cache/simple/simple_index_file.h b/net/disk_cache/simple/simple_index_file.h
index 44a5c6a273e6a648bd555cf94fa9ea9d23a55c57..ffa37f72dbf36a09e9c0d181b09882ab5c5b17b4 100644
--- a/net/disk_cache/simple/simple_index_file.h
+++ b/net/disk_cache/simple/simple_index_file.h
@@ -6,6 +6,7 @@
#define NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_FILE_H_
#include <string>
+#include <vector>
#include "base/basictypes.h"
#include "base/containers/hash_tables.h"
@@ -66,9 +67,9 @@ class NET_EXPORT_PRIVATE SimpleIndexFile {
scoped_ptr<SimpleIndex::EntrySet>, bool force_index_flush)>
IndexCompletionCallback;
- explicit SimpleIndexFile(base::SingleThreadTaskRunner* cache_thread,
- base::TaskRunner* worker_pool,
- const base::FilePath& index_file_directory);
+ SimpleIndexFile(base::SingleThreadTaskRunner* cache_thread,
+ base::TaskRunner* worker_pool,
+ const base::FilePath& index_file_directory);
virtual ~SimpleIndexFile();
// Get index entries based on current disk context.
@@ -88,9 +89,7 @@ class NET_EXPORT_PRIVATE SimpleIndexFile {
const base::Callback<void(int)>& reply_callback);
private:
- FRIEND_TEST_ALL_PREFIXES(SimpleIndexFileTest, IsIndexFileCorrupt);
- FRIEND_TEST_ALL_PREFIXES(SimpleIndexFileTest, IsIndexFileStale);
- FRIEND_TEST_ALL_PREFIXES(SimpleIndexFileTest, Serialize);
+ friend class TestSimpleIndexFile;
// Using the mtime of the file and its mtime, detects if the index file is
// stale.
« no previous file with comments | « no previous file | net/disk_cache/simple/simple_index_file.cc » ('j') | net/disk_cache/simple/simple_index_file.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698