OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_BLOCKFILE_ENTRY_IMPL_H_ | 5 #ifndef NET_DISK_CACHE_BLOCKFILE_ENTRY_IMPL_H_ |
6 #define NET_DISK_CACHE_BLOCKFILE_ENTRY_IMPL_H_ | 6 #define NET_DISK_CACHE_BLOCKFILE_ENTRY_IMPL_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "net/base/net_log.h" | 9 #include "net/base/net_log.h" |
10 #include "net/disk_cache/blockfile/disk_format.h" | 10 #include "net/disk_cache/blockfile/disk_format.h" |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 // initialized before this is called. |created| is true if the Entry was | 140 // initialized before this is called. |created| is true if the Entry was |
141 // created rather than opened. | 141 // created rather than opened. |
142 void BeginLogging(net::NetLog* net_log, bool created); | 142 void BeginLogging(net::NetLog* net_log, bool created); |
143 | 143 |
144 const net::BoundNetLog& net_log() const; | 144 const net::BoundNetLog& net_log() const; |
145 | 145 |
146 // Returns the number of blocks needed to store an EntryStore. | 146 // Returns the number of blocks needed to store an EntryStore. |
147 static int NumBlocksForEntry(int key_size); | 147 static int NumBlocksForEntry(int key_size); |
148 | 148 |
149 // Entry interface. | 149 // Entry interface. |
150 virtual void Doom() OVERRIDE; | 150 virtual void Doom() override; |
151 virtual void Close() OVERRIDE; | 151 virtual void Close() override; |
152 virtual std::string GetKey() const OVERRIDE; | 152 virtual std::string GetKey() const override; |
153 virtual base::Time GetLastUsed() const OVERRIDE; | 153 virtual base::Time GetLastUsed() const override; |
154 virtual base::Time GetLastModified() const OVERRIDE; | 154 virtual base::Time GetLastModified() const override; |
155 virtual int32 GetDataSize(int index) const OVERRIDE; | 155 virtual int32 GetDataSize(int index) const override; |
156 virtual int ReadData(int index, int offset, IOBuffer* buf, int buf_len, | 156 virtual int ReadData(int index, int offset, IOBuffer* buf, int buf_len, |
157 const CompletionCallback& callback) OVERRIDE; | 157 const CompletionCallback& callback) override; |
158 virtual int WriteData(int index, int offset, IOBuffer* buf, int buf_len, | 158 virtual int WriteData(int index, int offset, IOBuffer* buf, int buf_len, |
159 const CompletionCallback& callback, | 159 const CompletionCallback& callback, |
160 bool truncate) OVERRIDE; | 160 bool truncate) override; |
161 virtual int ReadSparseData(int64 offset, IOBuffer* buf, int buf_len, | 161 virtual int ReadSparseData(int64 offset, IOBuffer* buf, int buf_len, |
162 const CompletionCallback& callback) OVERRIDE; | 162 const CompletionCallback& callback) override; |
163 virtual int WriteSparseData(int64 offset, IOBuffer* buf, int buf_len, | 163 virtual int WriteSparseData(int64 offset, IOBuffer* buf, int buf_len, |
164 const CompletionCallback& callback) OVERRIDE; | 164 const CompletionCallback& callback) override; |
165 virtual int GetAvailableRange(int64 offset, int len, int64* start, | 165 virtual int GetAvailableRange(int64 offset, int len, int64* start, |
166 const CompletionCallback& callback) OVERRIDE; | 166 const CompletionCallback& callback) override; |
167 virtual bool CouldBeSparse() const OVERRIDE; | 167 virtual bool CouldBeSparse() const override; |
168 virtual void CancelSparseIO() OVERRIDE; | 168 virtual void CancelSparseIO() override; |
169 virtual int ReadyForSparseIO(const CompletionCallback& callback) OVERRIDE; | 169 virtual int ReadyForSparseIO(const CompletionCallback& callback) override; |
170 | 170 |
171 private: | 171 private: |
172 enum { | 172 enum { |
173 kNumStreams = 3 | 173 kNumStreams = 3 |
174 }; | 174 }; |
175 class UserBuffer; | 175 class UserBuffer; |
176 | 176 |
177 virtual ~EntryImpl(); | 177 virtual ~EntryImpl(); |
178 | 178 |
179 // Do all the work for ReadDataImpl and WriteDataImpl. Implemented as | 179 // Do all the work for ReadDataImpl and WriteDataImpl. Implemented as |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 scoped_ptr<SparseControl> sparse_; // Support for sparse entries. | 269 scoped_ptr<SparseControl> sparse_; // Support for sparse entries. |
270 | 270 |
271 net::BoundNetLog net_log_; | 271 net::BoundNetLog net_log_; |
272 | 272 |
273 DISALLOW_COPY_AND_ASSIGN(EntryImpl); | 273 DISALLOW_COPY_AND_ASSIGN(EntryImpl); |
274 }; | 274 }; |
275 | 275 |
276 } // namespace disk_cache | 276 } // namespace disk_cache |
277 | 277 |
278 #endif // NET_DISK_CACHE_BLOCKFILE_ENTRY_IMPL_H_ | 278 #endif // NET_DISK_CACHE_BLOCKFILE_ENTRY_IMPL_H_ |
OLD | NEW |