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

Side by Side Diff: net/base/upload_data.h

Issue 10832003: Add const accessors to URLRequest and UploadData. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 4 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
« no previous file with comments | « no previous file | net/url_request/url_request.h » ('j') | net/url_request/url_request.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_BASE_UPLOAD_DATA_H_ 5 #ifndef NET_BASE_UPLOAD_DATA_H_
6 #define NET_BASE_UPLOAD_DATA_H_ 6 #define NET_BASE_UPLOAD_DATA_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 216
217 // Returns true if the upload data is entirely in memory (i.e. the 217 // Returns true if the upload data is entirely in memory (i.e. the
218 // upload data is not chunked, and all elemnts are of TYPE_BYTES). 218 // upload data is not chunked, and all elemnts are of TYPE_BYTES).
219 bool IsInMemory() const; 219 bool IsInMemory() const;
220 220
221 // Resets the offset of each upload data element to zero, so that the 221 // Resets the offset of each upload data element to zero, so that the
222 // upload data can be reread. This can happen if the same upload data is 222 // upload data can be reread. This can happen if the same upload data is
223 // reused for a new UploadDataStream. 223 // reused for a new UploadDataStream.
224 void ResetOffset(); 224 void ResetOffset();
225 225
226 const std::vector<Element>* elements() const {
227 return &elements_;
228 }
229
226 std::vector<Element>* elements() { 230 std::vector<Element>* elements() {
gavinp 2012/07/27 20:28:56 A suggestion: can we rename this one elements_muta
vabr (Chromium) 2012/07/28 20:37:09 Done.
227 return &elements_; 231 return &elements_;
228 } 232 }
229 233
230 void SetElements(const std::vector<Element>& elements); 234 void SetElements(const std::vector<Element>& elements);
231 235
232 void swap_elements(std::vector<Element>* elements) { 236 void swap_elements(std::vector<Element>* elements) {
233 elements_.swap(*elements); 237 elements_.swap(*elements);
234 } 238 }
235 239
236 // Identifies a particular upload instance, which is used by the cache to 240 // Identifies a particular upload instance, which is used by the cache to
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 280
277 inline bool operator!=(const UploadData::Element& a, 281 inline bool operator!=(const UploadData::Element& a,
278 const UploadData::Element& b) { 282 const UploadData::Element& b) {
279 return !(a == b); 283 return !(a == b);
280 } 284 }
281 #endif // defined(UNIT_TEST) 285 #endif // defined(UNIT_TEST)
282 286
283 } // namespace net 287 } // namespace net
284 288
285 #endif // NET_BASE_UPLOAD_DATA_H_ 289 #endif // NET_BASE_UPLOAD_DATA_H_
OLDNEW
« no previous file with comments | « no previous file | net/url_request/url_request.h » ('j') | net/url_request/url_request.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698