| OLD | NEW |
| 1 // Copyright (c) 2009-2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009-2010 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_SPARSE_CONTROL_H_ | 5 #ifndef NET_DISK_CACHE_SPARSE_CONTROL_H_ |
| 6 #define NET_DISK_CACHE_SPARSE_CONTROL_H_ | 6 #define NET_DISK_CACHE_SPARSE_CONTROL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 void DoChildIOCompleted(int result); | 143 void DoChildIOCompleted(int result); |
| 144 | 144 |
| 145 // Invoked by the callback of asynchronous operations. | 145 // Invoked by the callback of asynchronous operations. |
| 146 void OnChildIOCompleted(int result); | 146 void OnChildIOCompleted(int result); |
| 147 | 147 |
| 148 // Reports to the user that we are done. | 148 // Reports to the user that we are done. |
| 149 void DoUserCallback(); | 149 void DoUserCallback(); |
| 150 void DoAbortCallbacks(); | 150 void DoAbortCallbacks(); |
| 151 | 151 |
| 152 EntryImpl* entry_; // The sparse entry. | 152 EntryImpl* entry_; // The sparse entry. |
| 153 Entry* child_; // The current child entry. | 153 EntryImpl* child_; // The current child entry. |
| 154 SparseOperation operation_; | 154 SparseOperation operation_; |
| 155 bool pending_; // True if any child IO operation returned pending. | 155 bool pending_; // True if any child IO operation returned pending. |
| 156 bool finished_; | 156 bool finished_; |
| 157 bool init_; | 157 bool init_; |
| 158 bool range_found_; // True if GetAvailableRange found something. | 158 bool range_found_; // True if GetAvailableRange found something. |
| 159 bool abort_; // True if we should abort the current operation ASAP. | 159 bool abort_; // True if we should abort the current operation ASAP. |
| 160 | 160 |
| 161 SparseHeader sparse_header_; // Data about the children of entry_. | 161 SparseHeader sparse_header_; // Data about the children of entry_. |
| 162 Bitmap children_map_; // The actual bitmap of children. | 162 Bitmap children_map_; // The actual bitmap of children. |
| 163 SparseData child_data_; // Parent and allocation map of child_. | 163 SparseData child_data_; // Parent and allocation map of child_. |
| 164 Bitmap child_map_; // The allocation map as a bitmap. | 164 Bitmap child_map_; // The allocation map as a bitmap. |
| 165 | 165 |
| 166 net::CompletionCallbackImpl<SparseControl> child_callback_; | 166 net::CompletionCallbackImpl<SparseControl> child_callback_; |
| 167 net::CompletionCallback* user_callback_; | 167 net::CompletionCallback* user_callback_; |
| 168 std::vector<net::CompletionCallback*> abort_callbacks_; | 168 std::vector<net::CompletionCallback*> abort_callbacks_; |
| 169 int64 offset_; // Current sparse offset. | 169 int64 offset_; // Current sparse offset. |
| 170 scoped_refptr<net::DrainableIOBuffer> user_buf_; | 170 scoped_refptr<net::DrainableIOBuffer> user_buf_; |
| 171 int buf_len_; // Bytes to read or write. | 171 int buf_len_; // Bytes to read or write. |
| 172 int child_offset_; // Offset to use for the current child. | 172 int child_offset_; // Offset to use for the current child. |
| 173 int child_len_; // Bytes to read or write for this child. | 173 int child_len_; // Bytes to read or write for this child. |
| 174 int result_; | 174 int result_; |
| 175 | 175 |
| 176 DISALLOW_COPY_AND_ASSIGN(SparseControl); | 176 DISALLOW_COPY_AND_ASSIGN(SparseControl); |
| 177 }; | 177 }; |
| 178 | 178 |
| 179 } // namespace disk_cache | 179 } // namespace disk_cache |
| 180 | 180 |
| 181 #endif // NET_DISK_CACHE_SPARSE_CONTROL_H_ | 181 #endif // NET_DISK_CACHE_SPARSE_CONTROL_H_ |
| OLD | NEW |