| OLD | NEW |
| 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 // 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 19 matching lines...) Expand all Loading... |
| 30 class FraudulentCertificateReporter; | 30 class FraudulentCertificateReporter; |
| 31 class FtpTransactionFactory; | 31 class FtpTransactionFactory; |
| 32 class HostResolver; | 32 class HostResolver; |
| 33 class HttpAuthHandlerFactory; | 33 class HttpAuthHandlerFactory; |
| 34 class HttpTransactionFactory; | 34 class HttpTransactionFactory; |
| 35 class NetworkDelegate; | 35 class NetworkDelegate; |
| 36 class ServerBoundCertService; | 36 class ServerBoundCertService; |
| 37 class ProxyService; | 37 class ProxyService; |
| 38 class URLRequest; | 38 class URLRequest; |
| 39 class URLRequestJobFactory; | 39 class URLRequestJobFactory; |
| 40 class URLRequestThrottlerManager; |
| 40 | 41 |
| 41 // Subclass to provide application-specific context for URLRequest | 42 // Subclass to provide application-specific context for URLRequest |
| 42 // instances. Note that URLRequestContext typically does not provide storage for | 43 // instances. Note that URLRequestContext typically does not provide storage for |
| 43 // these member variables, since they may be shared. For the ones that aren't | 44 // these member variables, since they may be shared. For the ones that aren't |
| 44 // shared, URLRequestContextStorage can be helpful in defining their storage. | 45 // shared, URLRequestContextStorage can be helpful in defining their storage. |
| 45 class NET_EXPORT URLRequestContext | 46 class NET_EXPORT URLRequestContext |
| 46 : public base::RefCountedThreadSafe<URLRequestContext>, | 47 : public base::RefCountedThreadSafe<URLRequestContext>, |
| 47 NON_EXPORTED_BASE(public base::NonThreadSafe) { | 48 NON_EXPORTED_BASE(public base::NonThreadSafe) { |
| 48 public: | 49 public: |
| 49 URLRequestContext(); | 50 URLRequestContext(); |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 const std::string& referrer_charset() const { return referrer_charset_; } | 185 const std::string& referrer_charset() const { return referrer_charset_; } |
| 185 void set_referrer_charset(const std::string& charset) { | 186 void set_referrer_charset(const std::string& charset) { |
| 186 referrer_charset_ = charset; | 187 referrer_charset_ = charset; |
| 187 } | 188 } |
| 188 | 189 |
| 189 const URLRequestJobFactory* job_factory() const { return job_factory_; } | 190 const URLRequestJobFactory* job_factory() const { return job_factory_; } |
| 190 void set_job_factory(const URLRequestJobFactory* job_factory) { | 191 void set_job_factory(const URLRequestJobFactory* job_factory) { |
| 191 job_factory_ = job_factory; | 192 job_factory_ = job_factory; |
| 192 } | 193 } |
| 193 | 194 |
| 195 // May be NULL. |
| 196 URLRequestThrottlerManager* throttler_manager() const { |
| 197 return throttler_manager_; |
| 198 } |
| 199 void set_throttler_manager(URLRequestThrottlerManager* throttler_manager) { |
| 200 throttler_manager_ = throttler_manager; |
| 201 } |
| 202 |
| 194 // Gets the URLRequest objects that hold a reference to this | 203 // Gets the URLRequest objects that hold a reference to this |
| 195 // URLRequestContext. | 204 // URLRequestContext. |
| 196 std::set<const URLRequest*>* url_requests() const { | 205 std::set<const URLRequest*>* url_requests() const { |
| 197 return url_requests_.get(); | 206 return url_requests_.get(); |
| 198 } | 207 } |
| 199 | 208 |
| 200 void AssertNoURLRequests() const; | 209 void AssertNoURLRequests() const; |
| 201 | 210 |
| 202 protected: | 211 protected: |
| 203 friend class base::RefCountedThreadSafe<URLRequestContext>; | 212 friend class base::RefCountedThreadSafe<URLRequestContext>; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 229 scoped_ptr<FtpAuthCache> ftp_auth_cache_; | 238 scoped_ptr<FtpAuthCache> ftp_auth_cache_; |
| 230 std::string accept_language_; | 239 std::string accept_language_; |
| 231 std::string accept_charset_; | 240 std::string accept_charset_; |
| 232 // The charset of the referrer where this request comes from. It's not | 241 // The charset of the referrer where this request comes from. It's not |
| 233 // used in communication with a server but is used to construct a suggested | 242 // used in communication with a server but is used to construct a suggested |
| 234 // filename for file download. | 243 // filename for file download. |
| 235 std::string referrer_charset_; | 244 std::string referrer_charset_; |
| 236 HttpTransactionFactory* http_transaction_factory_; | 245 HttpTransactionFactory* http_transaction_factory_; |
| 237 FtpTransactionFactory* ftp_transaction_factory_; | 246 FtpTransactionFactory* ftp_transaction_factory_; |
| 238 const URLRequestJobFactory* job_factory_; | 247 const URLRequestJobFactory* job_factory_; |
| 248 URLRequestThrottlerManager* throttler_manager_; |
| 239 | 249 |
| 240 // --------------------------------------------------------------------------- | 250 // --------------------------------------------------------------------------- |
| 241 // Important: When adding any new members below, consider whether they need to | 251 // Important: When adding any new members below, consider whether they need to |
| 242 // be added to CopyFrom. | 252 // be added to CopyFrom. |
| 243 // --------------------------------------------------------------------------- | 253 // --------------------------------------------------------------------------- |
| 244 | 254 |
| 245 scoped_ptr<std::set<const URLRequest*> > url_requests_; | 255 scoped_ptr<std::set<const URLRequest*> > url_requests_; |
| 246 | 256 |
| 247 DISALLOW_COPY_AND_ASSIGN(URLRequestContext); | 257 DISALLOW_COPY_AND_ASSIGN(URLRequestContext); |
| 248 }; | 258 }; |
| 249 | 259 |
| 250 } // namespace net | 260 } // namespace net |
| 251 | 261 |
| 252 #endif // NET_URL_REQUEST_URL_REQUEST_CONTEXT_H_ | 262 #endif // NET_URL_REQUEST_URL_REQUEST_CONTEXT_H_ |
| OLD | NEW |