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

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

Issue 52028: Net module changes to support caching responses to a POST request. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 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
« no previous file with comments | « no previous file | net/http/http_cache.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/ref_counted.h" 11 #include "base/ref_counted.h"
12 12
13 namespace net { 13 namespace net {
14 14
15 class UploadData : public base::RefCounted<UploadData> { 15 class UploadData : public base::RefCounted<UploadData> {
16 public: 16 public:
17 UploadData() {} 17 UploadData() : identifier_(0) {}
18 18
19 enum Type { 19 enum Type {
20 TYPE_BYTES, 20 TYPE_BYTES,
21 TYPE_FILE 21 TYPE_FILE
22 }; 22 };
23 23
24 class Element { 24 class Element {
25 public: 25 public:
26 Element() : type_(TYPE_BYTES), file_range_offset_(0), 26 Element() : type_(TYPE_BYTES), file_range_offset_(0),
27 file_range_length_(kuint64max) { 27 file_range_length_(kuint64max) {
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 uint64 GetContentLength() const; 84 uint64 GetContentLength() const;
85 85
86 const std::vector<Element>& elements() const { 86 const std::vector<Element>& elements() const {
87 return elements_; 87 return elements_;
88 } 88 }
89 89
90 void set_elements(const std::vector<Element>& elements) { 90 void set_elements(const std::vector<Element>& elements) {
91 elements_ = elements; 91 elements_ = elements;
92 } 92 }
93 93
94 void swap_elements(std::vector<Element>* elements) {
95 elements_.swap(*elements);
96 }
97
98 // Identifies a particular upload instance, which is used by the cache to
99 // formulate a cache key. This value should be unique across browser
100 // sessions. A value of 0 is used to indicate an unspecified identifier.
101 void set_identifier(int64 id) { identifier_ = id; }
102 int64 identifier() const { return identifier_; }
103
94 private: 104 private:
95 std::vector<Element> elements_; 105 std::vector<Element> elements_;
106 int64 identifier_;
96 }; 107 };
97 108
98 } // namespace net 109 } // namespace net
99 110
100 #endif // NET_BASE_UPLOAD_DATA_H_ 111 #endif // NET_BASE_UPLOAD_DATA_H_
OLDNEW
« no previous file with comments | « no previous file | net/http/http_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698