| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/hash_tables.h" | 9 #include "base/hash_tables.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 bool truncate); | 105 bool truncate); |
| 106 virtual int ReadSparseData(int64 offset, net::IOBuffer* buf, int buf_len, | 106 virtual int ReadSparseData(int64 offset, net::IOBuffer* buf, int buf_len, |
| 107 net::CompletionCallback* completion_callback); | 107 net::CompletionCallback* completion_callback); |
| 108 virtual int WriteSparseData(int64 offset, net::IOBuffer* buf, int buf_len, | 108 virtual int WriteSparseData(int64 offset, net::IOBuffer* buf, int buf_len, |
| 109 net::CompletionCallback* completion_callback); | 109 net::CompletionCallback* completion_callback); |
| 110 virtual int GetAvailableRange(int64 offset, int len, int64* start, | 110 virtual int GetAvailableRange(int64 offset, int len, int64* start, |
| 111 CompletionCallback* callback); | 111 CompletionCallback* callback); |
| 112 virtual bool CouldBeSparse() const; | 112 virtual bool CouldBeSparse() const; |
| 113 virtual void CancelSparseIO() {} | 113 virtual void CancelSparseIO() {} |
| 114 virtual int ReadyForSparseIO(net::CompletionCallback* completion_callback); | 114 virtual int ReadyForSparseIO(net::CompletionCallback* completion_callback); |
| 115 virtual void UpdateRankForExternalCacheHit(); |
| 115 | 116 |
| 116 private: | 117 private: |
| 117 typedef base::hash_map<int, MemEntryImpl*> EntryMap; | 118 typedef base::hash_map<int, MemEntryImpl*> EntryMap; |
| 118 | 119 |
| 119 enum { | 120 enum { |
| 120 NUM_STREAMS = 3 | 121 NUM_STREAMS = 3 |
| 121 }; | 122 }; |
| 122 | 123 |
| 123 virtual ~MemEntryImpl(); | 124 virtual ~MemEntryImpl(); |
| 124 | 125 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 bool doomed_; // True if this entry was removed from the cache. | 182 bool doomed_; // True if this entry was removed from the cache. |
| 182 | 183 |
| 183 net::BoundNetLog net_log_; | 184 net::BoundNetLog net_log_; |
| 184 | 185 |
| 185 DISALLOW_COPY_AND_ASSIGN(MemEntryImpl); | 186 DISALLOW_COPY_AND_ASSIGN(MemEntryImpl); |
| 186 }; | 187 }; |
| 187 | 188 |
| 188 } // namespace disk_cache | 189 } // namespace disk_cache |
| 189 | 190 |
| 190 #endif // NET_DISK_CACHE_MEM_ENTRY_IMPL_H_ | 191 #endif // NET_DISK_CACHE_MEM_ENTRY_IMPL_H_ |
| OLD | NEW |