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 <string> | 11 #include <string> |
11 #include <vector> | 12 #include <vector> |
12 | 13 |
13 #include "base/containers/hash_tables.h" | 14 #include "base/containers/hash_tables.h" |
14 #include "base/containers/linked_list.h" | 15 #include "base/containers/linked_list.h" |
15 #include "base/gtest_prod_util.h" | 16 #include "base/gtest_prod_util.h" |
16 #include "base/macros.h" | 17 #include "base/macros.h" |
17 #include "base/memory/scoped_ptr.h" | |
18 #include "base/time/time.h" | 18 #include "base/time/time.h" |
19 #include "net/disk_cache/disk_cache.h" | 19 #include "net/disk_cache/disk_cache.h" |
20 #include "net/log/net_log.h" | 20 #include "net/log/net_log.h" |
21 | 21 |
22 namespace disk_cache { | 22 namespace disk_cache { |
23 | 23 |
24 class MemBackendImpl; | 24 class MemBackendImpl; |
25 | 25 |
26 // This class implements the Entry interface for the memory-only cache. An | 26 // This class implements the Entry interface for the memory-only cache. An |
27 // object of this class represents a single entry on the cache. We use two types | 27 // object of this class represents a single entry on the cache. We use two types |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 | 165 |
166 std::string key_; | 166 std::string key_; |
167 std::vector<char> data_[kNumStreams]; // User data. | 167 std::vector<char> data_[kNumStreams]; // User data. |
168 int ref_count_; | 168 int ref_count_; |
169 | 169 |
170 int child_id_; // The ID of a child entry. | 170 int child_id_; // The ID of a child entry. |
171 int child_first_pos_; // The position of the first byte in a child | 171 int child_first_pos_; // The position of the first byte in a child |
172 // entry. | 172 // entry. |
173 // Pointer to the parent entry, or nullptr if this entry is a parent entry. | 173 // Pointer to the parent entry, or nullptr if this entry is a parent entry. |
174 MemEntryImpl* parent_; | 174 MemEntryImpl* parent_; |
175 scoped_ptr<EntryMap> children_; | 175 std::unique_ptr<EntryMap> children_; |
176 | 176 |
177 base::Time last_modified_; | 177 base::Time last_modified_; |
178 base::Time last_used_; | 178 base::Time last_used_; |
179 MemBackendImpl* backend_; // Back pointer to the cache. | 179 MemBackendImpl* backend_; // Back pointer to the cache. |
180 bool doomed_; // True if this entry was removed from the cache. | 180 bool doomed_; // True if this entry was removed from the cache. |
181 | 181 |
182 net::BoundNetLog net_log_; | 182 net::BoundNetLog net_log_; |
183 | 183 |
184 DISALLOW_COPY_AND_ASSIGN(MemEntryImpl); | 184 DISALLOW_COPY_AND_ASSIGN(MemEntryImpl); |
185 }; | 185 }; |
186 | 186 |
187 } // namespace disk_cache | 187 } // namespace disk_cache |
188 | 188 |
189 #endif // NET_DISK_CACHE_MEMORY_MEM_ENTRY_IMPL_H_ | 189 #endif // NET_DISK_CACHE_MEMORY_MEM_ENTRY_IMPL_H_ |
OLD | NEW |