| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 "base/hash_tables.h" | 8 #include "base/hash_tables.h" |
| 9 #include "base/scoped_ptr.h" | 9 #include "base/scoped_ptr.h" |
| 10 #include "net/disk_cache/disk_cache.h" | 10 #include "net/disk_cache/disk_cache.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 virtual int ReadData(int index, int offset, net::IOBuffer* buf, int buf_len, | 61 virtual int ReadData(int index, int offset, net::IOBuffer* buf, int buf_len, |
| 62 net::CompletionCallback* completion_callback); | 62 net::CompletionCallback* completion_callback); |
| 63 virtual int WriteData(int index, int offset, net::IOBuffer* buf, int buf_len, | 63 virtual int WriteData(int index, int offset, net::IOBuffer* buf, int buf_len, |
| 64 net::CompletionCallback* completion_callback, | 64 net::CompletionCallback* completion_callback, |
| 65 bool truncate); | 65 bool truncate); |
| 66 virtual int ReadSparseData(int64 offset, net::IOBuffer* buf, int buf_len, | 66 virtual int ReadSparseData(int64 offset, net::IOBuffer* buf, int buf_len, |
| 67 net::CompletionCallback* completion_callback); | 67 net::CompletionCallback* completion_callback); |
| 68 virtual int WriteSparseData(int64 offset, net::IOBuffer* buf, int buf_len, | 68 virtual int WriteSparseData(int64 offset, net::IOBuffer* buf, int buf_len, |
| 69 net::CompletionCallback* completion_callback); | 69 net::CompletionCallback* completion_callback); |
| 70 virtual int GetAvailableRange(int64 offset, int len, int64* start); | 70 virtual int GetAvailableRange(int64 offset, int len, int64* start); |
| 71 virtual void CancelSparseIO() {} |
| 72 virtual int ReadyForSparseIO(net::CompletionCallback* completion_callback); |
| 71 | 73 |
| 72 // Performs the initialization of a EntryImpl that will be added to the | 74 // Performs the initialization of a EntryImpl that will be added to the |
| 73 // cache. | 75 // cache. |
| 74 bool CreateEntry(const std::string& key); | 76 bool CreateEntry(const std::string& key); |
| 75 | 77 |
| 76 // Permanently destroys this entry. | 78 // Permanently destroys this entry. |
| 77 void InternalDoom(); | 79 void InternalDoom(); |
| 78 | 80 |
| 79 void Open(); | 81 void Open(); |
| 80 bool InUse(); | 82 bool InUse(); |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 base::Time last_used_; | 156 base::Time last_used_; |
| 155 MemBackendImpl* backend_; // Back pointer to the cache. | 157 MemBackendImpl* backend_; // Back pointer to the cache. |
| 156 bool doomed_; // True if this entry was removed from the cache. | 158 bool doomed_; // True if this entry was removed from the cache. |
| 157 | 159 |
| 158 DISALLOW_EVIL_CONSTRUCTORS(MemEntryImpl); | 160 DISALLOW_EVIL_CONSTRUCTORS(MemEntryImpl); |
| 159 }; | 161 }; |
| 160 | 162 |
| 161 } // namespace disk_cache | 163 } // namespace disk_cache |
| 162 | 164 |
| 163 #endif // NET_DISK_CACHE_MEM_ENTRY_IMPL_H_ | 165 #endif // NET_DISK_CACHE_MEM_ENTRY_IMPL_H_ |
| OLD | NEW |