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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 | 115 |
116 private: | 116 private: |
117 typedef base::hash_map<int, MemEntryImpl*> EntryMap; | 117 typedef base::hash_map<int, MemEntryImpl*> EntryMap; |
118 | 118 |
119 enum { | 119 enum { |
120 NUM_STREAMS = 3 | 120 NUM_STREAMS = 3 |
121 }; | 121 }; |
122 | 122 |
123 ~MemEntryImpl(); | 123 virtual ~MemEntryImpl(); |
124 | 124 |
125 // Do all the work for corresponding public functions. Implemented as | 125 // Do all the work for corresponding public functions. Implemented as |
126 // separate functions to make logging of results simpler. | 126 // separate functions to make logging of results simpler. |
127 int InternalReadData(int index, int offset, net::IOBuffer* buf, int buf_len); | 127 int InternalReadData(int index, int offset, net::IOBuffer* buf, int buf_len); |
128 int InternalWriteData(int index, int offset, net::IOBuffer* buf, int buf_len, | 128 int InternalWriteData(int index, int offset, net::IOBuffer* buf, int buf_len, |
129 bool truncate); | 129 bool truncate); |
130 int InternalReadSparseData(int64 offset, net::IOBuffer* buf, int buf_len); | 130 int InternalReadSparseData(int64 offset, net::IOBuffer* buf, int buf_len); |
131 int InternalWriteSparseData(int64 offset, net::IOBuffer* buf, int buf_len); | 131 int InternalWriteSparseData(int64 offset, net::IOBuffer* buf, int buf_len); |
132 | 132 |
133 // Old Entry interface. | 133 // Old Entry interface. |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 bool doomed_; // True if this entry was removed from the cache. | 181 bool doomed_; // True if this entry was removed from the cache. |
182 | 182 |
183 net::BoundNetLog net_log_; | 183 net::BoundNetLog net_log_; |
184 | 184 |
185 DISALLOW_COPY_AND_ASSIGN(MemEntryImpl); | 185 DISALLOW_COPY_AND_ASSIGN(MemEntryImpl); |
186 }; | 186 }; |
187 | 187 |
188 } // namespace disk_cache | 188 } // namespace disk_cache |
189 | 189 |
190 #endif // NET_DISK_CACHE_MEM_ENTRY_IMPL_H_ | 190 #endif // NET_DISK_CACHE_MEM_ENTRY_IMPL_H_ |
OLD | NEW |