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_BLOCKFILE_ENTRY_IMPL_H_ | 5 #ifndef NET_DISK_CACHE_BLOCKFILE_ENTRY_IMPL_H_ |
6 #define NET_DISK_CACHE_BLOCKFILE_ENTRY_IMPL_H_ | 6 #define NET_DISK_CACHE_BLOCKFILE_ENTRY_IMPL_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
| 10 #include <memory> |
| 11 |
10 #include "base/macros.h" | 12 #include "base/macros.h" |
11 #include "base/memory/scoped_ptr.h" | |
12 #include "net/disk_cache/blockfile/disk_format.h" | 13 #include "net/disk_cache/blockfile/disk_format.h" |
13 #include "net/disk_cache/blockfile/storage_block-inl.h" | 14 #include "net/disk_cache/blockfile/storage_block-inl.h" |
14 #include "net/disk_cache/blockfile/storage_block.h" | 15 #include "net/disk_cache/blockfile/storage_block.h" |
15 #include "net/disk_cache/disk_cache.h" | 16 #include "net/disk_cache/disk_cache.h" |
16 #include "net/log/net_log.h" | 17 #include "net/log/net_log.h" |
17 | 18 |
18 namespace disk_cache { | 19 namespace disk_cache { |
19 | 20 |
20 class BackendImpl; | 21 class BackendImpl; |
21 class InFlightBackendIO; | 22 class InFlightBackendIO; |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 // actual cleanup. | 271 // actual cleanup. |
271 void GetData(int index, char** buffer, Addr* address); | 272 void GetData(int index, char** buffer, Addr* address); |
272 | 273 |
273 // Logs this entry to the internal trace buffer. | 274 // Logs this entry to the internal trace buffer. |
274 void Log(const char* msg); | 275 void Log(const char* msg); |
275 | 276 |
276 CacheEntryBlock entry_; // Key related information for this entry. | 277 CacheEntryBlock entry_; // Key related information for this entry. |
277 CacheRankingsBlock node_; // Rankings related information for this entry. | 278 CacheRankingsBlock node_; // Rankings related information for this entry. |
278 base::WeakPtr<BackendImpl> backend_; // Back pointer to the cache. | 279 base::WeakPtr<BackendImpl> backend_; // Back pointer to the cache. |
279 base::WeakPtr<InFlightBackendIO> background_queue_; // In-progress queue. | 280 base::WeakPtr<InFlightBackendIO> background_queue_; // In-progress queue. |
280 scoped_ptr<UserBuffer> user_buffers_[kNumStreams]; // Stores user data. | 281 std::unique_ptr<UserBuffer> user_buffers_[kNumStreams]; // Stores user data. |
281 // Files to store external user data and key. | 282 // Files to store external user data and key. |
282 scoped_refptr<File> files_[kNumStreams + 1]; | 283 scoped_refptr<File> files_[kNumStreams + 1]; |
283 mutable std::string key_; // Copy of the key. | 284 mutable std::string key_; // Copy of the key. |
284 int unreported_size_[kNumStreams]; // Bytes not reported yet to the backend. | 285 int unreported_size_[kNumStreams]; // Bytes not reported yet to the backend. |
285 bool doomed_; // True if this entry was removed from the cache. | 286 bool doomed_; // True if this entry was removed from the cache. |
286 bool read_only_; // True if not yet writing. | 287 bool read_only_; // True if not yet writing. |
287 bool dirty_; // True if we detected that this is a dirty entry. | 288 bool dirty_; // True if we detected that this is a dirty entry. |
288 scoped_ptr<SparseControl> sparse_; // Support for sparse entries. | 289 std::unique_ptr<SparseControl> sparse_; // Support for sparse entries. |
289 | 290 |
290 net::BoundNetLog net_log_; | 291 net::BoundNetLog net_log_; |
291 | 292 |
292 DISALLOW_COPY_AND_ASSIGN(EntryImpl); | 293 DISALLOW_COPY_AND_ASSIGN(EntryImpl); |
293 }; | 294 }; |
294 | 295 |
295 } // namespace disk_cache | 296 } // namespace disk_cache |
296 | 297 |
297 #endif // NET_DISK_CACHE_BLOCKFILE_ENTRY_IMPL_H_ | 298 #endif // NET_DISK_CACHE_BLOCKFILE_ENTRY_IMPL_H_ |
OLD | NEW |