| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_MEM_ENTRY_IMPL_H__ | 5 #ifndef NET_DISK_CACHE_MEM_ENTRY_IMPL_H__ |
| 6 #define NET_DISK_CACHE_MEM_ENTRY_IMPL_H__ | 6 #define NET_DISK_CACHE_MEM_ENTRY_IMPL_H__ |
| 7 | 7 |
| 8 #include "net/disk_cache/disk_cache.h" | 8 #include "net/disk_cache/disk_cache.h" |
| 9 | 9 |
| 10 namespace disk_cache { | 10 namespace disk_cache { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 } | 50 } |
| 51 | 51 |
| 52 void set_prev(MemEntryImpl* prev) { | 52 void set_prev(MemEntryImpl* prev) { |
| 53 prev_ = prev; | 53 prev_ = prev; |
| 54 } | 54 } |
| 55 | 55 |
| 56 void Open(); | 56 void Open(); |
| 57 bool InUse(); | 57 bool InUse(); |
| 58 | 58 |
| 59 private: | 59 private: |
| 60 enum { |
| 61 NUM_STREAMS = 3 |
| 62 }; |
| 63 |
| 60 ~MemEntryImpl(); | 64 ~MemEntryImpl(); |
| 61 | 65 |
| 62 // Grows and cleans up the data buffer. | 66 // Grows and cleans up the data buffer. |
| 63 void PrepareTarget(int index, int offset, int buf_len); | 67 void PrepareTarget(int index, int offset, int buf_len); |
| 64 | 68 |
| 65 // Updates ranking information. | 69 // Updates ranking information. |
| 66 void UpdateRank(bool modified); | 70 void UpdateRank(bool modified); |
| 67 | 71 |
| 68 std::string key_; | 72 std::string key_; |
| 69 std::vector<char> data_[2]; // User data. | 73 std::vector<char> data_[NUM_STREAMS]; // User data. |
| 70 int32 data_size_[2]; | 74 int32 data_size_[NUM_STREAMS]; |
| 71 int ref_count_; | 75 int ref_count_; |
| 72 | 76 |
| 73 MemEntryImpl* next_; // Pointers for the LRU list. | 77 MemEntryImpl* next_; // Pointers for the LRU list. |
| 74 MemEntryImpl* prev_; | 78 MemEntryImpl* prev_; |
| 75 base::Time last_modified_; // LRU information. | 79 base::Time last_modified_; // LRU information. |
| 76 base::Time last_used_; | 80 base::Time last_used_; |
| 77 MemBackendImpl* backend_; // Back pointer to the cache. | 81 MemBackendImpl* backend_; // Back pointer to the cache. |
| 78 bool doomed_; // True if this entry was removed from the cache. | 82 bool doomed_; // True if this entry was removed from the cache. |
| 79 | 83 |
| 80 DISALLOW_EVIL_CONSTRUCTORS(MemEntryImpl); | 84 DISALLOW_EVIL_CONSTRUCTORS(MemEntryImpl); |
| 81 }; | 85 }; |
| 82 | 86 |
| 83 } // namespace disk_cache | 87 } // namespace disk_cache |
| 84 | 88 |
| 85 #endif // NET_DISK_CACHE_MEM_ENTRY_IMPL_H__ | 89 #endif // NET_DISK_CACHE_MEM_ENTRY_IMPL_H__ |
| 86 | 90 |
| OLD | NEW |