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

Side by Side Diff: net/url_request/url_request_context.h

Issue 9317018: referrer_charset is a lie. It's really the user's default_charset. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 10 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 | « net/http/http_content_disposition_unittest.cc ('k') | net/url_request/url_request_context.cc » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 // This class represents contextual information (cookies, cache, etc.) 5 // This class represents contextual information (cookies, cache, etc.)
6 // that's useful when processing resource requests. 6 // that's useful when processing resource requests.
7 // The class is reference-counted so that it can be cleaned up after any 7 // The class is reference-counted so that it can be cleaned up after any
8 // requests that are using it have been completed. 8 // requests that are using it have been completed.
9 9
10 #ifndef NET_URL_REQUEST_URL_REQUEST_CONTEXT_H_ 10 #ifndef NET_URL_REQUEST_URL_REQUEST_CONTEXT_H_
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 const std::string& accept_language() const { return accept_language_; } 170 const std::string& accept_language() const { return accept_language_; }
171 void set_accept_language(const std::string& accept_language) { 171 void set_accept_language(const std::string& accept_language) {
172 accept_language_ = accept_language; 172 accept_language_ = accept_language;
173 } 173 }
174 174
175 // Gets the UA string to use for the given URL. Pass an invalid URL (such as 175 // Gets the UA string to use for the given URL. Pass an invalid URL (such as
176 // GURL()) to get the default UA string. Subclasses should override this 176 // GURL()) to get the default UA string. Subclasses should override this
177 // method to provide a UA string. 177 // method to provide a UA string.
178 virtual const std::string& GetUserAgent(const GURL& url) const; 178 virtual const std::string& GetUserAgent(const GURL& url) const;
179 179
180 // In general, referrer_charset is not known when URLRequestContext is 180 const std::string& default_charset() const { return default_charset_; }
181 // constructed. So, we need a setter. 181 void set_default_charset(const std::string& charset) {
182 const std::string& referrer_charset() const { return referrer_charset_; } 182 default_charset_ = charset;
183 void set_referrer_charset(const std::string& charset) {
184 referrer_charset_ = charset;
185 } 183 }
186 184
187 const URLRequestJobFactory* job_factory() const { return job_factory_; } 185 const URLRequestJobFactory* job_factory() const { return job_factory_; }
188 void set_job_factory(const URLRequestJobFactory* job_factory) { 186 void set_job_factory(const URLRequestJobFactory* job_factory) {
189 job_factory_ = job_factory; 187 job_factory_ = job_factory;
190 } 188 }
191 189
192 protected: 190 protected:
193 friend class base::RefCountedThreadSafe<URLRequestContext>; 191 friend class base::RefCountedThreadSafe<URLRequestContext>;
194 192
(...skipping 17 matching lines...) Expand all
212 HttpAuthHandlerFactory* http_auth_handler_factory_; 210 HttpAuthHandlerFactory* http_auth_handler_factory_;
213 ProxyService* proxy_service_; 211 ProxyService* proxy_service_;
214 scoped_refptr<SSLConfigService> ssl_config_service_; 212 scoped_refptr<SSLConfigService> ssl_config_service_;
215 NetworkDelegate* network_delegate_; 213 NetworkDelegate* network_delegate_;
216 HttpServerProperties* http_server_properties_; 214 HttpServerProperties* http_server_properties_;
217 scoped_refptr<CookieStore> cookie_store_; 215 scoped_refptr<CookieStore> cookie_store_;
218 TransportSecurityState* transport_security_state_; 216 TransportSecurityState* transport_security_state_;
219 scoped_ptr<FtpAuthCache> ftp_auth_cache_; 217 scoped_ptr<FtpAuthCache> ftp_auth_cache_;
220 std::string accept_language_; 218 std::string accept_language_;
221 std::string accept_charset_; 219 std::string accept_charset_;
222 // The charset of the referrer where this request comes from. It's not 220 // The user's default charset. It's not used in communication with a server
223 // used in communication with a server but is used to construct a suggested 221 // but is used to construct a suggested filename for file download.
224 // filename for file download. 222 std::string default_charset_;
225 std::string referrer_charset_;
226 HttpTransactionFactory* http_transaction_factory_; 223 HttpTransactionFactory* http_transaction_factory_;
227 FtpTransactionFactory* ftp_transaction_factory_; 224 FtpTransactionFactory* ftp_transaction_factory_;
228 const URLRequestJobFactory* job_factory_; 225 const URLRequestJobFactory* job_factory_;
229 226
230 // --------------------------------------------------------------------------- 227 // ---------------------------------------------------------------------------
231 // Important: When adding any new members below, consider whether they need to 228 // Important: When adding any new members below, consider whether they need to
232 // be added to CopyFrom. 229 // be added to CopyFrom.
233 // --------------------------------------------------------------------------- 230 // ---------------------------------------------------------------------------
234 231
235 DISALLOW_COPY_AND_ASSIGN(URLRequestContext); 232 DISALLOW_COPY_AND_ASSIGN(URLRequestContext);
236 }; 233 };
237 234
238 } // namespace net 235 } // namespace net
239 236
240 #endif // NET_URL_REQUEST_URL_REQUEST_CONTEXT_H_ 237 #endif // NET_URL_REQUEST_URL_REQUEST_CONTEXT_H_
OLDNEW
« no previous file with comments | « net/http/http_content_disposition_unittest.cc ('k') | net/url_request/url_request_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698