Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Side by Side Diff: net/disk_cache/blockfile/sparse_control.h

Issue 266243004: Clang format slam. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_SPARSE_CONTROL_H_ 5 #ifndef NET_DISK_CACHE_BLOCKFILE_SPARSE_CONTROL_H_
6 #define NET_DISK_CACHE_BLOCKFILE_SPARSE_CONTROL_H_ 6 #define NET_DISK_CACHE_BLOCKFILE_SPARSE_CONTROL_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 // Performs a quick test to see if the entry is sparse or not, without 52 // Performs a quick test to see if the entry is sparse or not, without
53 // generating disk IO (so the answer provided is only a best effort). 53 // generating disk IO (so the answer provided is only a best effort).
54 bool CouldBeSparse() const; 54 bool CouldBeSparse() const;
55 55
56 // Performs an actual sparse read or write operation for this entry. |op| is 56 // Performs an actual sparse read or write operation for this entry. |op| is
57 // the operation to perform, |offset| is the desired sparse offset, |buf| and 57 // the operation to perform, |offset| is the desired sparse offset, |buf| and
58 // |buf_len| specify the actual data to use and |callback| is the callback 58 // |buf_len| specify the actual data to use and |callback| is the callback
59 // to use for asynchronous operations. See the description of the Read / 59 // to use for asynchronous operations. See the description of the Read /
60 // WriteSparseData for details about the arguments. The return value is the 60 // WriteSparseData for details about the arguments. The return value is the
61 // number of bytes read or written, or a net error code. 61 // number of bytes read or written, or a net error code.
62 int StartIO(SparseOperation op, int64 offset, net::IOBuffer* buf, 62 int StartIO(SparseOperation op,
63 int buf_len, const CompletionCallback& callback); 63 int64 offset,
64 net::IOBuffer* buf,
65 int buf_len,
66 const CompletionCallback& callback);
64 67
65 // Implements Entry::GetAvailableRange(). 68 // Implements Entry::GetAvailableRange().
66 int GetAvailableRange(int64 offset, int len, int64* start); 69 int GetAvailableRange(int64 offset, int len, int64* start);
67 70
68 // Cancels the current sparse operation (if any). 71 // Cancels the current sparse operation (if any).
69 void CancelIO(); 72 void CancelIO();
70 73
71 // Returns OK if the entry can be used for new IO or ERR_IO_PENDING if we are 74 // Returns OK if the entry can be used for new IO or ERR_IO_PENDING if we are
72 // busy. If the entry is busy, we'll invoke the callback when we are ready 75 // busy. If the entry is busy, we'll invoke the callback when we are ready
73 // again. See disk_cache::Entry::ReadyToUse() for more info. 76 // again. See disk_cache::Entry::ReadyToUse() for more info.
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 void DoUserCallback(); 149 void DoUserCallback();
147 void DoAbortCallbacks(); 150 void DoAbortCallbacks();
148 151
149 EntryImpl* entry_; // The sparse entry. 152 EntryImpl* entry_; // The sparse entry.
150 EntryImpl* child_; // The current child entry. 153 EntryImpl* child_; // The current child entry.
151 SparseOperation operation_; 154 SparseOperation operation_;
152 bool pending_; // True if any child IO operation returned pending. 155 bool pending_; // True if any child IO operation returned pending.
153 bool finished_; 156 bool finished_;
154 bool init_; 157 bool init_;
155 bool range_found_; // True if GetAvailableRange found something. 158 bool range_found_; // True if GetAvailableRange found something.
156 bool abort_; // True if we should abort the current operation ASAP. 159 bool abort_; // True if we should abort the current operation ASAP.
157 160
158 SparseHeader sparse_header_; // Data about the children of entry_. 161 SparseHeader sparse_header_; // Data about the children of entry_.
159 Bitmap children_map_; // The actual bitmap of children. 162 Bitmap children_map_; // The actual bitmap of children.
160 SparseData child_data_; // Parent and allocation map of child_. 163 SparseData child_data_; // Parent and allocation map of child_.
161 Bitmap child_map_; // The allocation map as a bitmap. 164 Bitmap child_map_; // The allocation map as a bitmap.
162 165
163 CompletionCallback user_callback_; 166 CompletionCallback user_callback_;
164 std::vector<CompletionCallback> abort_callbacks_; 167 std::vector<CompletionCallback> abort_callbacks_;
165 int64 offset_; // Current sparse offset. 168 int64 offset_; // Current sparse offset.
166 scoped_refptr<net::DrainableIOBuffer> user_buf_; 169 scoped_refptr<net::DrainableIOBuffer> user_buf_;
167 int buf_len_; // Bytes to read or write. 170 int buf_len_; // Bytes to read or write.
168 int child_offset_; // Offset to use for the current child. 171 int child_offset_; // Offset to use for the current child.
169 int child_len_; // Bytes to read or write for this child. 172 int child_len_; // Bytes to read or write for this child.
170 int result_; 173 int result_;
171 174
172 DISALLOW_COPY_AND_ASSIGN(SparseControl); 175 DISALLOW_COPY_AND_ASSIGN(SparseControl);
173 }; 176 };
174 177
175 } // namespace disk_cache 178 } // namespace disk_cache
176 179
177 #endif // NET_DISK_CACHE_BLOCKFILE_SPARSE_CONTROL_H_ 180 #endif // NET_DISK_CACHE_BLOCKFILE_SPARSE_CONTROL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698