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

Side by Side Diff: content/public/browser/download_url_parameters.h

Issue 11571025: Initial CL for Downloads resumption. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed CanResumeDownload (unused) and updated comment in RDH::BeginDownload. Created 7 years, 11 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 CONTENT_PUBLIC_BROWSER_DOWNLOAD_URL_PARAMETERS_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_DOWNLOAD_URL_PARAMETERS_H_
6 #define CONTENT_PUBLIC_BROWSER_DOWNLOAD_URL_PARAMETERS_H_ 6 #define CONTENT_PUBLIC_BROWSER_DOWNLOAD_URL_PARAMETERS_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 content_initiated_ = content_initiated; 60 content_initiated_ = content_initiated;
61 } 61 }
62 void add_request_header(const std::string& name, const std::string& value) { 62 void add_request_header(const std::string& name, const std::string& value) {
63 request_headers_.push_back(make_pair(name, value)); 63 request_headers_.push_back(make_pair(name, value));
64 } 64 }
65 void set_referrer(const Referrer& referrer) { referrer_ = referrer; } 65 void set_referrer(const Referrer& referrer) { referrer_ = referrer; }
66 void set_referrer_encoding(const std::string& referrer_encoding) { 66 void set_referrer_encoding(const std::string& referrer_encoding) {
67 referrer_encoding_ = referrer_encoding; 67 referrer_encoding_ = referrer_encoding;
68 } 68 }
69 void set_load_flags(int load_flags) { load_flags_ |= load_flags; } 69 void set_load_flags(int load_flags) { load_flags_ |= load_flags; }
70 void set_last_modified(const std::string& last_modified) {
71 last_modified_ = last_modified;
72 }
73 void set_etag(const std::string& etag) {
74 etag_ = etag;
75 }
70 void set_method(const std::string& method) { 76 void set_method(const std::string& method) {
71 method_ = method; 77 method_ = method;
72 } 78 }
73 void set_post_body(const std::string& post_body) { 79 void set_post_body(const std::string& post_body) {
74 post_body_ = post_body; 80 post_body_ = post_body;
75 } 81 }
76 void set_prefer_cache(bool prefer_cache) { 82 void set_prefer_cache(bool prefer_cache) {
77 prefer_cache_ = prefer_cache; 83 prefer_cache_ = prefer_cache;
78 } 84 }
79 void set_post_id(int64 post_id) { post_id_ = post_id; } 85 void set_post_id(int64 post_id) { post_id_ = post_id; }
(...skipping 11 matching lines...) Expand all
91 save_info_.hash_state = hash_state; 97 save_info_.hash_state = hash_state;
92 } 98 }
93 void set_prompt(bool prompt) { save_info_.prompt_for_save_location = prompt; } 99 void set_prompt(bool prompt) { save_info_.prompt_for_save_location = prompt; }
94 void set_file_stream(scoped_ptr<net::FileStream> file_stream) { 100 void set_file_stream(scoped_ptr<net::FileStream> file_stream) {
95 save_info_.file_stream = file_stream.Pass(); 101 save_info_.file_stream = file_stream.Pass();
96 } 102 }
97 103
98 const OnStartedCallback& callback() const { return callback_; } 104 const OnStartedCallback& callback() const { return callback_; }
99 bool content_initiated() const { return content_initiated_; } 105 bool content_initiated() const { return content_initiated_; }
100 int load_flags() const { return load_flags_; } 106 int load_flags() const { return load_flags_; }
107 const std::string& last_modified() { return last_modified_; }
108 const std::string& etag() { return etag_; }
101 const std::string& method() const { return method_; } 109 const std::string& method() const { return method_; }
102 const std::string& post_body() const { return post_body_; } 110 const std::string& post_body() const { return post_body_; }
103 int64 post_id() const { return post_id_; } 111 int64 post_id() const { return post_id_; }
104 bool prefer_cache() const { return prefer_cache_; } 112 bool prefer_cache() const { return prefer_cache_; }
105 const Referrer& referrer() const { return referrer_; } 113 const Referrer& referrer() const { return referrer_; }
106 const std::string& referrer_encoding() const { return referrer_encoding_; } 114 const std::string& referrer_encoding() const { return referrer_encoding_; }
107 int render_process_host_id() const { return render_process_host_id_; } 115 int render_process_host_id() const { return render_process_host_id_; }
108 int render_view_host_routing_id() const { 116 int render_view_host_routing_id() const {
109 return render_view_host_routing_id_; 117 return render_view_host_routing_id_;
110 } 118 }
(...skipping 20 matching lines...) Expand all
131 // will not have a file_stream attached to it after this call. 139 // will not have a file_stream attached to it after this call.
132 scoped_ptr<net::FileStream> GetFileStream() { 140 scoped_ptr<net::FileStream> GetFileStream() {
133 return save_info_.file_stream.Pass(); 141 return save_info_.file_stream.Pass();
134 } 142 }
135 143
136 private: 144 private:
137 OnStartedCallback callback_; 145 OnStartedCallback callback_;
138 bool content_initiated_; 146 bool content_initiated_;
139 RequestHeadersType request_headers_; 147 RequestHeadersType request_headers_;
140 int load_flags_; 148 int load_flags_;
149 std::string last_modified_;
150 std::string etag_;
141 std::string method_; 151 std::string method_;
142 std::string post_body_; 152 std::string post_body_;
143 int64 post_id_; 153 int64 post_id_;
144 bool prefer_cache_; 154 bool prefer_cache_;
145 Referrer referrer_; 155 Referrer referrer_;
146 std::string referrer_encoding_; 156 std::string referrer_encoding_;
147 int render_process_host_id_; 157 int render_process_host_id_;
148 int render_view_host_routing_id_; 158 int render_view_host_routing_id_;
149 ResourceContext* resource_context_; 159 ResourceContext* resource_context_;
150 ResourceDispatcherHost* resource_dispatcher_host_; 160 ResourceDispatcherHost* resource_dispatcher_host_;
151 DownloadSaveInfo save_info_; 161 DownloadSaveInfo save_info_;
152 GURL url_; 162 GURL url_;
153 163
154 DISALLOW_COPY_AND_ASSIGN(DownloadUrlParameters); 164 DISALLOW_COPY_AND_ASSIGN(DownloadUrlParameters);
155 }; 165 };
156 166
157 } // namespace content 167 } // namespace content
158 168
159 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_URL_PARAMETERS_H_ 169 #endif // CONTENT_PUBLIC_BROWSER_DOWNLOAD_URL_PARAMETERS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698