| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_MEMORY_MEM_ENTRY_IMPL_H_ | 5 #ifndef NET_DISK_CACHE_MEMORY_MEM_ENTRY_IMPL_H_ |
| 6 #define NET_DISK_CACHE_MEMORY_MEM_ENTRY_IMPL_H_ | 6 #define NET_DISK_CACHE_MEMORY_MEM_ENTRY_IMPL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <unordered_map> | 12 #include <unordered_map> |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "base/containers/linked_list.h" | 15 #include "base/containers/linked_list.h" |
| 16 #include "base/gtest_prod_util.h" | 16 #include "base/gtest_prod_util.h" |
| 17 #include "base/macros.h" | 17 #include "base/macros.h" |
| 18 #include "base/time/time.h" | 18 #include "base/time/time.h" |
| 19 #include "base/trace_event/memory_usage_estimator.h" |
| 19 #include "net/base/net_export.h" | 20 #include "net/base/net_export.h" |
| 20 #include "net/disk_cache/disk_cache.h" | 21 #include "net/disk_cache/disk_cache.h" |
| 21 #include "net/log/net_log_with_source.h" | 22 #include "net/log/net_log_with_source.h" |
| 22 | 23 |
| 23 namespace net { | 24 namespace net { |
| 24 class NetLog; | 25 class NetLog; |
| 25 } | 26 } |
| 26 | 27 |
| 27 namespace disk_cache { | 28 namespace disk_cache { |
| 28 | 29 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 IOBuffer* buf, | 124 IOBuffer* buf, |
| 124 int buf_len, | 125 int buf_len, |
| 125 const CompletionCallback& callback) override; | 126 const CompletionCallback& callback) override; |
| 126 int GetAvailableRange(int64_t offset, | 127 int GetAvailableRange(int64_t offset, |
| 127 int len, | 128 int len, |
| 128 int64_t* start, | 129 int64_t* start, |
| 129 const CompletionCallback& callback) override; | 130 const CompletionCallback& callback) override; |
| 130 bool CouldBeSparse() const override; | 131 bool CouldBeSparse() const override; |
| 131 void CancelSparseIO() override {} | 132 void CancelSparseIO() override {} |
| 132 int ReadyForSparseIO(const CompletionCallback& callback) override; | 133 int ReadyForSparseIO(const CompletionCallback& callback) override; |
| 134 size_t EstimateMemoryUsage() const; |
| 133 | 135 |
| 134 private: | 136 private: |
| 135 MemEntryImpl(MemBackendImpl* backend, | 137 MemEntryImpl(MemBackendImpl* backend, |
| 136 const std::string& key, | 138 const std::string& key, |
| 137 int child_id, | 139 int child_id, |
| 138 MemEntryImpl* parent, | 140 MemEntryImpl* parent, |
| 139 net::NetLog* net_log); | 141 net::NetLog* net_log); |
| 140 | 142 |
| 141 using EntryMap = std::unordered_map<int, MemEntryImpl*>; | 143 using EntryMap = std::unordered_map<int, MemEntryImpl*>; |
| 142 | 144 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 bool doomed_; // True if this entry was removed from the cache. | 187 bool doomed_; // True if this entry was removed from the cache. |
| 186 | 188 |
| 187 net::NetLogWithSource net_log_; | 189 net::NetLogWithSource net_log_; |
| 188 | 190 |
| 189 DISALLOW_COPY_AND_ASSIGN(MemEntryImpl); | 191 DISALLOW_COPY_AND_ASSIGN(MemEntryImpl); |
| 190 }; | 192 }; |
| 191 | 193 |
| 192 } // namespace disk_cache | 194 } // namespace disk_cache |
| 193 | 195 |
| 194 #endif // NET_DISK_CACHE_MEMORY_MEM_ENTRY_IMPL_H_ | 196 #endif // NET_DISK_CACHE_MEMORY_MEM_ENTRY_IMPL_H_ |
| OLD | NEW |