| 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_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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "net/base/net_log.h" | 10 #include "net/base/net_log.h" |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 virtual bool CouldBeSparse() const; | 145 virtual bool CouldBeSparse() const; |
| 146 virtual void CancelSparseIO(); | 146 virtual void CancelSparseIO(); |
| 147 virtual int ReadyForSparseIO(net::CompletionCallback* completion_callback); | 147 virtual int ReadyForSparseIO(net::CompletionCallback* completion_callback); |
| 148 | 148 |
| 149 private: | 149 private: |
| 150 enum { | 150 enum { |
| 151 kNumStreams = 3 | 151 kNumStreams = 3 |
| 152 }; | 152 }; |
| 153 class UserBuffer; | 153 class UserBuffer; |
| 154 | 154 |
| 155 ~EntryImpl(); | 155 virtual ~EntryImpl(); |
| 156 | 156 |
| 157 // Do all the work for ReadDataImpl and WriteDataImpl. Implemented as | 157 // Do all the work for ReadDataImpl and WriteDataImpl. Implemented as |
| 158 // separate functions to make logging of results simpler. | 158 // separate functions to make logging of results simpler. |
| 159 int InternalReadData(int index, int offset, net::IOBuffer* buf, | 159 int InternalReadData(int index, int offset, net::IOBuffer* buf, |
| 160 int buf_len, CompletionCallback* callback); | 160 int buf_len, CompletionCallback* callback); |
| 161 int InternalWriteData(int index, int offset, net::IOBuffer* buf, int buf_len, | 161 int InternalWriteData(int index, int offset, net::IOBuffer* buf, int buf_len, |
| 162 CompletionCallback* callback, bool truncate); | 162 CompletionCallback* callback, bool truncate); |
| 163 | 163 |
| 164 // Initializes the storage for an internal or external data block. | 164 // Initializes the storage for an internal or external data block. |
| 165 bool CreateDataBlock(int index, int size); | 165 bool CreateDataBlock(int index, int size); |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 scoped_ptr<SparseControl> sparse_; // Support for sparse entries. | 246 scoped_ptr<SparseControl> sparse_; // Support for sparse entries. |
| 247 | 247 |
| 248 net::BoundNetLog net_log_; | 248 net::BoundNetLog net_log_; |
| 249 | 249 |
| 250 DISALLOW_COPY_AND_ASSIGN(EntryImpl); | 250 DISALLOW_COPY_AND_ASSIGN(EntryImpl); |
| 251 }; | 251 }; |
| 252 | 252 |
| 253 } // namespace disk_cache | 253 } // namespace disk_cache |
| 254 | 254 |
| 255 #endif // NET_DISK_CACHE_ENTRY_IMPL_H_ | 255 #endif // NET_DISK_CACHE_ENTRY_IMPL_H_ |
| OLD | NEW |