Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 24 #include "net/base/cache_type.h" | 24 #include "net/base/cache_type.h" |
| 25 #include "net/base/net_export.h" | 25 #include "net/base/net_export.h" |
| 26 #include "net/disk_cache/disk_cache.h" | 26 #include "net/disk_cache/disk_cache.h" |
| 27 #include "net/disk_cache/simple/simple_entry_impl.h" | 27 #include "net/disk_cache/simple/simple_entry_impl.h" |
| 28 #include "net/disk_cache/simple/simple_experiment.h" | 28 #include "net/disk_cache/simple/simple_experiment.h" |
| 29 #include "net/disk_cache/simple/simple_index_delegate.h" | 29 #include "net/disk_cache/simple/simple_index_delegate.h" |
| 30 | 30 |
| 31 namespace base { | 31 namespace base { |
| 32 class SingleThreadTaskRunner; | 32 class SingleThreadTaskRunner; |
| 33 class TaskRunner; | 33 class TaskRunner; |
| 34 namespace trace_event { | |
| 35 class ProcessMemoryDump; | |
| 36 } | |
| 34 } | 37 } |
| 35 | 38 |
| 36 namespace disk_cache { | 39 namespace disk_cache { |
| 37 | 40 |
| 38 // SimpleBackendImpl is a new cache backend that stores entries in individual | 41 // SimpleBackendImpl is a new cache backend that stores entries in individual |
| 39 // files. | 42 // files. |
| 40 // See http://www.chromium.org/developers/design-documents/network-stack/disk-ca che/very-simple-backend | 43 // See http://www.chromium.org/developers/design-documents/network-stack/disk-ca che/very-simple-backend |
| 41 // | 44 // |
| 42 // The SimpleBackendImpl provides safe iteration; mutating entries during | 45 // The SimpleBackendImpl provides safe iteration; mutating entries during |
| 43 // iteration cannot cause a crash. It is undefined whether entries created or | 46 // iteration cannot cause a crash. It is undefined whether entries created or |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 110 int DoomEntriesSince(base::Time initial_time, | 113 int DoomEntriesSince(base::Time initial_time, |
| 111 const CompletionCallback& callback) override; | 114 const CompletionCallback& callback) override; |
| 112 int CalculateSizeOfAllEntries(const CompletionCallback& callback) override; | 115 int CalculateSizeOfAllEntries(const CompletionCallback& callback) override; |
| 113 int CalculateSizeOfEntriesBetween( | 116 int CalculateSizeOfEntriesBetween( |
| 114 base::Time initial_time, | 117 base::Time initial_time, |
| 115 base::Time end_time, | 118 base::Time end_time, |
| 116 const CompletionCallback& callback) override; | 119 const CompletionCallback& callback) override; |
| 117 std::unique_ptr<Iterator> CreateIterator() override; | 120 std::unique_ptr<Iterator> CreateIterator() override; |
| 118 void GetStats(base::StringPairs* stats) override; | 121 void GetStats(base::StringPairs* stats) override; |
| 119 void OnExternalCacheHit(const std::string& key) override; | 122 void OnExternalCacheHit(const std::string& key) override; |
| 123 void DumpMemoryStats(base::trace_event::ProcessMemoryDump* pmd, | |
| 124 const std::string& parent_absolute_name) const override; | |
|
ssid
2017/01/31 22:24:19
Do we have stats about how often we use the blockf
xunjieli
2017/02/01 01:15:52
We are moving towards using SimpleCache everywhere
| |
| 120 | 125 |
| 121 private: | 126 private: |
| 122 class SimpleIterator; | 127 class SimpleIterator; |
| 123 friend class SimpleIterator; | 128 friend class SimpleIterator; |
| 124 | 129 |
| 125 using EntryMap = std::unordered_map<uint64_t, SimpleEntryImpl*>; | 130 using EntryMap = std::unordered_map<uint64_t, SimpleEntryImpl*>; |
| 126 | 131 |
| 127 using InitializeIndexCallback = | 132 using InitializeIndexCallback = |
| 128 base::Callback<void(base::Time mtime, uint64_t max_size, int result)>; | 133 base::Callback<void(base::Time mtime, uint64_t max_size, int result)>; |
| 129 | 134 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 227 // operations to be run at the completion of the Doom. | 232 // operations to be run at the completion of the Doom. |
| 228 std::unordered_map<uint64_t, std::vector<base::Closure>> | 233 std::unordered_map<uint64_t, std::vector<base::Closure>> |
| 229 entries_pending_doom_; | 234 entries_pending_doom_; |
| 230 | 235 |
| 231 net::NetLog* const net_log_; | 236 net::NetLog* const net_log_; |
| 232 }; | 237 }; |
| 233 | 238 |
| 234 } // namespace disk_cache | 239 } // namespace disk_cache |
| 235 | 240 |
| 236 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_BACKEND_IMPL_H_ | 241 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_BACKEND_IMPL_H_ |
| OLD | NEW |