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_ENTRY_IMPL_H__ | 5 #ifndef NET_DISK_CACHE_ENTRY_IMPL_H__ |
6 #define NET_DISK_CACHE_ENTRY_IMPL_H__ | 6 #define NET_DISK_CACHE_ENTRY_IMPL_H__ |
7 | 7 |
8 #include "net/disk_cache/disk_cache.h" | 8 #include "net/disk_cache/disk_cache.h" |
9 #include "net/disk_cache/storage_block.h" | 9 #include "net/disk_cache/storage_block.h" |
10 #include "net/disk_cache/storage_block-inl.h" | 10 #include "net/disk_cache/storage_block-inl.h" |
11 | 11 |
12 namespace disk_cache { | 12 namespace disk_cache { |
13 | 13 |
14 class BackendImpl; | 14 class BackendImpl; |
15 | 15 |
16 // This class implements the Entry interface. An object of this | 16 // This class implements the Entry interface. An object of this |
17 // class represents a single entry on the cache. | 17 // class represents a single entry on the cache. |
18 class EntryImpl : public Entry, public base::RefCounted<EntryImpl> { | 18 class EntryImpl : public Entry, public base::RefCounted<EntryImpl> { |
19 friend class base::RefCounted<EntryImpl>; | 19 friend class base::RefCounted<EntryImpl>; |
20 public: | 20 public: |
21 EntryImpl(BackendImpl* backend, Addr address); | 21 EntryImpl(BackendImpl* backend, Addr address); |
22 | 22 |
23 // Entry interface. | 23 // Entry interface. |
24 virtual void Doom(); | 24 virtual void Doom(); |
25 virtual void Close(); | 25 virtual void Close(); |
26 virtual std::string GetKey() const; | 26 virtual std::string GetKey() const; |
27 virtual Time GetLastUsed() const; | 27 virtual base::Time GetLastUsed() const; |
28 virtual Time GetLastModified() const; | 28 virtual base::Time GetLastModified() const; |
29 virtual int32 GetDataSize(int index) const; | 29 virtual int32 GetDataSize(int index) const; |
30 virtual int ReadData(int index, int offset, char* buf, int buf_len, | 30 virtual int ReadData(int index, int offset, char* buf, int buf_len, |
31 net::CompletionCallback* completion_callback); | 31 net::CompletionCallback* completion_callback); |
32 virtual int WriteData(int index, int offset, const char* buf, int buf_len, | 32 virtual int WriteData(int index, int offset, const char* buf, int buf_len, |
33 net::CompletionCallback* completion_callback, | 33 net::CompletionCallback* completion_callback, |
34 bool truncate); | 34 bool truncate); |
35 | 35 |
36 inline CacheEntryBlock* entry() { | 36 inline CacheEntryBlock* entry() { |
37 return &entry_; | 37 return &entry_; |
38 } | 38 } |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 int unreported_size_[2]; // Bytes not reported yet to the backend. | 135 int unreported_size_[2]; // Bytes not reported yet to the backend. |
136 bool doomed_; // True if this entry was removed from the cache. | 136 bool doomed_; // True if this entry was removed from the cache. |
137 | 137 |
138 DISALLOW_EVIL_CONSTRUCTORS(EntryImpl); | 138 DISALLOW_EVIL_CONSTRUCTORS(EntryImpl); |
139 }; | 139 }; |
140 | 140 |
141 } // namespace disk_cache | 141 } // namespace disk_cache |
142 | 142 |
143 #endif // NET_DISK_CACHE_ENTRY_IMPL_H__ | 143 #endif // NET_DISK_CACHE_ENTRY_IMPL_H__ |
144 | 144 |
OLD | NEW |