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> | 10 #include <memory> |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 | 142 |
143 // Generates a histogram for the time spent working on this operation. | 143 // Generates a histogram for the time spent working on this operation. |
144 void ReportIOTime(Operation op, const base::TimeTicks& start); | 144 void ReportIOTime(Operation op, const base::TimeTicks& start); |
145 | 145 |
146 // Logs a begin event and enables logging for the EntryImpl. Will also cause | 146 // Logs a begin event and enables logging for the EntryImpl. Will also cause |
147 // an end event to be logged on destruction. The EntryImpl must have its key | 147 // an end event to be logged on destruction. The EntryImpl must have its key |
148 // initialized before this is called. |created| is true if the Entry was | 148 // initialized before this is called. |created| is true if the Entry was |
149 // created rather than opened. | 149 // created rather than opened. |
150 void BeginLogging(net::NetLog* net_log, bool created); | 150 void BeginLogging(net::NetLog* net_log, bool created); |
151 | 151 |
152 const net::BoundNetLog& net_log() const; | 152 const net::NetLogWithSource& net_log() const; |
153 | 153 |
154 // Returns the number of blocks needed to store an EntryStore. | 154 // Returns the number of blocks needed to store an EntryStore. |
155 static int NumBlocksForEntry(int key_size); | 155 static int NumBlocksForEntry(int key_size); |
156 | 156 |
157 // Entry interface. | 157 // Entry interface. |
158 void Doom() override; | 158 void Doom() override; |
159 void Close() override; | 159 void Close() override; |
160 std::string GetKey() const override; | 160 std::string GetKey() const override; |
161 base::Time GetLastUsed() const override; | 161 base::Time GetLastUsed() const override; |
162 base::Time GetLastModified() const override; | 162 base::Time GetLastModified() const override; |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 std::unique_ptr<UserBuffer> user_buffers_[kNumStreams]; // Stores user data. | 281 std::unique_ptr<UserBuffer> user_buffers_[kNumStreams]; // Stores user data. |
282 // Files to store external user data and key. | 282 // Files to store external user data and key. |
283 scoped_refptr<File> files_[kNumStreams + 1]; | 283 scoped_refptr<File> files_[kNumStreams + 1]; |
284 mutable std::string key_; // Copy of the key. | 284 mutable std::string key_; // Copy of the key. |
285 int unreported_size_[kNumStreams]; // Bytes not reported yet to the backend. | 285 int unreported_size_[kNumStreams]; // Bytes not reported yet to the backend. |
286 bool doomed_; // True if this entry was removed from the cache. | 286 bool doomed_; // True if this entry was removed from the cache. |
287 bool read_only_; // True if not yet writing. | 287 bool read_only_; // True if not yet writing. |
288 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. |
289 std::unique_ptr<SparseControl> sparse_; // Support for sparse entries. | 289 std::unique_ptr<SparseControl> sparse_; // Support for sparse entries. |
290 | 290 |
291 net::BoundNetLog net_log_; | 291 net::NetLogWithSource net_log_; |
292 | 292 |
293 DISALLOW_COPY_AND_ASSIGN(EntryImpl); | 293 DISALLOW_COPY_AND_ASSIGN(EntryImpl); |
294 }; | 294 }; |
295 | 295 |
296 } // namespace disk_cache | 296 } // namespace disk_cache |
297 | 297 |
298 #endif // NET_DISK_CACHE_BLOCKFILE_ENTRY_IMPL_H_ | 298 #endif // NET_DISK_CACHE_BLOCKFILE_ENTRY_IMPL_H_ |
OLD | NEW |