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

Side by Side Diff: net/disk_cache/simple/simple_backend_impl.h

Issue 14295013: Simple Cache: DoomEntriesBetween() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix an actual bug in DoomEntry Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/disk_cache/backend_unittest.cc ('k') | net/disk_cache/simple/simple_backend_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_DISK_CACHE_SIMPLE_SIMPLE_BACKEND_IMPL_H_ 5 #ifndef NET_DISK_CACHE_SIMPLE_SIMPLE_BACKEND_IMPL_H_
6 #define NET_DISK_CACHE_SIMPLE_SIMPLE_BACKEND_IMPL_H_ 6 #define NET_DISK_CACHE_SIMPLE_SIMPLE_BACKEND_IMPL_H_
7 7
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 15 matching lines...) Expand all
26 // SimpleBackendImpl is a new cache backend that stores entries in individual 26 // SimpleBackendImpl is a new cache backend that stores entries in individual
27 // files. 27 // files.
28 28
29 // It is currently a work in progress, missing many features of a real cache, 29 // It is currently a work in progress, missing many features of a real cache,
30 // such as eviction. 30 // such as eviction.
31 31
32 // See http://www.chromium.org/developers/design-documents/network-stack/disk-ca che/very-simple-backend 32 // See http://www.chromium.org/developers/design-documents/network-stack/disk-ca che/very-simple-backend
33 33
34 class SimpleIndex; 34 class SimpleIndex;
35 35
36 class NET_EXPORT_PRIVATE SimpleBackendImpl : public Backend { 36 class NET_EXPORT_PRIVATE SimpleBackendImpl : public Backend,
37 public base::SupportsWeakPtr<SimpleBackendImpl> {
37 public: 38 public:
38 SimpleBackendImpl(const base::FilePath& path, int max_bytes, 39 SimpleBackendImpl(const base::FilePath& path, int max_bytes,
39 net::CacheType type, 40 net::CacheType type,
40 base::SingleThreadTaskRunner* cache_thread, 41 base::SingleThreadTaskRunner* cache_thread,
41 net::NetLog* net_log); 42 net::NetLog* net_log);
42 43
43 virtual ~SimpleBackendImpl(); 44 virtual ~SimpleBackendImpl();
44 45
45 // Must run on IO Thread. 46 // Must run on IO Thread.
46 int Init(const CompletionCallback& completion_callback); 47 int Init(const CompletionCallback& completion_callback);
(...skipping 19 matching lines...) Expand all
66 virtual void GetStats( 67 virtual void GetStats(
67 std::vector<std::pair<std::string, std::string> >* stats) OVERRIDE; 68 std::vector<std::pair<std::string, std::string> >* stats) OVERRIDE;
68 virtual void OnExternalCacheHit(const std::string& key) OVERRIDE; 69 virtual void OnExternalCacheHit(const std::string& key) OVERRIDE;
69 70
70 private: 71 private:
71 typedef base::Callback<void(int result)> InitializeIndexCallback; 72 typedef base::Callback<void(int result)> InitializeIndexCallback;
72 73
73 // Must run on IO Thread. 74 // Must run on IO Thread.
74 void InitializeIndex(const CompletionCallback& callback, int result); 75 void InitializeIndex(const CompletionCallback& callback, int result);
75 76
77 // Dooms all entries previously accessed between |initial_time| and
78 // |end_time|. Invoked when the index is ready.
79 void IndexReadyForDoom(base::Time initial_time,
80 base::Time end_time,
81 const CompletionCallback& callback,
82 int result);
83
76 // Try to create the directory if it doesn't exist. 84 // Try to create the directory if it doesn't exist.
77 // Must run on Cache Thread. 85 // Must run on Cache Thread.
78 static void CreateDirectory( 86 static void CreateDirectory(
79 base::SingleThreadTaskRunner* io_thread, 87 base::SingleThreadTaskRunner* io_thread,
80 const base::FilePath& path, 88 const base::FilePath& path,
81 const InitializeIndexCallback& initialize_index_callback); 89 const InitializeIndexCallback& initialize_index_callback);
82 90
83 const base::FilePath path_; 91 const base::FilePath path_;
84 scoped_ptr<SimpleIndex> index_; 92 scoped_ptr<SimpleIndex> index_;
85 const scoped_refptr<base::SingleThreadTaskRunner> cache_thread_; 93 const scoped_refptr<base::SingleThreadTaskRunner> cache_thread_;
86 }; 94 };
87 95
88 } // namespace disk_cache 96 } // namespace disk_cache
89 97
90 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_BACKEND_IMPL_H_ 98 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_BACKEND_IMPL_H_
OLDNEW
« no previous file with comments | « net/disk_cache/backend_unittest.cc ('k') | net/disk_cache/simple/simple_backend_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698