| 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_V3_H_ | 5 #ifndef NET_DISK_CACHE_BLOCKFILE_ENTRY_IMPL_V3_H_ |
| 6 #define NET_DISK_CACHE_BLOCKFILE_ENTRY_IMPL_V3_H_ | 6 #define NET_DISK_CACHE_BLOCKFILE_ENTRY_IMPL_V3_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> |
| 10 #include <string> | 11 #include <string> |
| 11 | 12 |
| 12 #include "base/macros.h" | 13 #include "base/macros.h" |
| 13 #include "base/memory/scoped_ptr.h" | |
| 14 #include "net/disk_cache/blockfile/disk_format_v3.h" | 14 #include "net/disk_cache/blockfile/disk_format_v3.h" |
| 15 #include "net/disk_cache/blockfile/storage_block.h" | 15 #include "net/disk_cache/blockfile/storage_block.h" |
| 16 #include "net/disk_cache/disk_cache.h" | 16 #include "net/disk_cache/disk_cache.h" |
| 17 #include "net/log/net_log.h" | 17 #include "net/log/net_log.h" |
| 18 | 18 |
| 19 namespace disk_cache { | 19 namespace disk_cache { |
| 20 | 20 |
| 21 class BackendImplV3; | 21 class BackendImplV3; |
| 22 class SparseControlV3; | 22 class SparseControlV3; |
| 23 | 23 |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 // point; there is no need to report any storage-size change, only to do the | 193 // point; there is no need to report any storage-size change, only to do the |
| 194 // actual cleanup. | 194 // actual cleanup. |
| 195 void GetData(int index, char** buffer, Addr* address); | 195 void GetData(int index, char** buffer, Addr* address); |
| 196 | 196 |
| 197 // Generates a histogram for the time spent working on this operation. | 197 // Generates a histogram for the time spent working on this operation. |
| 198 void ReportIOTime(Operation op, const base::TimeTicks& start); | 198 void ReportIOTime(Operation op, const base::TimeTicks& start); |
| 199 | 199 |
| 200 // Logs this entry to the internal trace buffer. | 200 // Logs this entry to the internal trace buffer. |
| 201 void Log(const char* msg); | 201 void Log(const char* msg); |
| 202 | 202 |
| 203 scoped_ptr<EntryRecord> entry_; // Basic record for this entry. | 203 std::unique_ptr<EntryRecord> entry_; // Basic record for this entry. |
| 204 scoped_ptr<ShortEntryRecord> short_entry_; // Valid for evicted entries. | 204 std::unique_ptr<ShortEntryRecord> short_entry_; // Valid for evicted entries. |
| 205 base::WeakPtr<BackendImplV3> backend_; // Back pointer to the cache. | 205 base::WeakPtr<BackendImplV3> backend_; // Back pointer to the cache. |
| 206 scoped_ptr<UserBuffer> user_buffers_[kNumStreams]; // Stores user data. | 206 std::unique_ptr<UserBuffer> user_buffers_[kNumStreams]; // Stores user data. |
| 207 mutable std::string key_; // Copy of the key. | 207 mutable std::string key_; // Copy of the key. |
| 208 Addr address_; | 208 Addr address_; |
| 209 int unreported_size_[kNumStreams]; // Bytes not reported yet to the backend. | 209 int unreported_size_[kNumStreams]; // Bytes not reported yet to the backend. |
| 210 bool doomed_; // True if this entry was removed from the cache. | 210 bool doomed_; // True if this entry was removed from the cache. |
| 211 bool read_only_; | 211 bool read_only_; |
| 212 bool dirty_; // True if there is something to write. | 212 bool dirty_; // True if there is something to write. |
| 213 bool modified_; | 213 bool modified_; |
| 214 // scoped_ptr<SparseControlV3> sparse_; // Support for sparse entries. | 214 // std::unique_ptr<SparseControlV3> sparse_; // Support for sparse entries. |
| 215 | 215 |
| 216 net::BoundNetLog net_log_; | 216 net::BoundNetLog net_log_; |
| 217 | 217 |
| 218 DISALLOW_COPY_AND_ASSIGN(EntryImplV3); | 218 DISALLOW_COPY_AND_ASSIGN(EntryImplV3); |
| 219 }; | 219 }; |
| 220 | 220 |
| 221 } // namespace disk_cache | 221 } // namespace disk_cache |
| 222 | 222 |
| 223 #endif // NET_DISK_CACHE_BLOCKFILE_ENTRY_IMPL_V3_H_ | 223 #endif // NET_DISK_CACHE_BLOCKFILE_ENTRY_IMPL_V3_H_ |
| OLD | NEW |