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

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

Issue 10203002: Make URLRequestThrottlerManager a member of URLRequestContext. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ready for review. Created 8 years, 8 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 // 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
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
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 URLRequestThrottlerManager* throttler_manager() const {
196 return throttler_manager_;
197 }
198 void set_throttler_manager(URLRequestThrottlerManager* throttler_manager) {
199 throttler_manager_ = throttler_manager;
200 }
201
194 // Gets the URLRequest objects that hold a reference to this 202 // Gets the URLRequest objects that hold a reference to this
195 // URLRequestContext. 203 // URLRequestContext.
196 std::set<const URLRequest*>* url_requests() const { 204 std::set<const URLRequest*>* url_requests() const {
197 return url_requests_.get(); 205 return url_requests_.get();
198 } 206 }
199 207
200 void AssertNoURLRequests() const; 208 void AssertNoURLRequests() const;
201 209
202 protected: 210 protected:
203 friend class base::RefCountedThreadSafe<URLRequestContext>; 211 friend class base::RefCountedThreadSafe<URLRequestContext>;
(...skipping 25 matching lines...) Expand all
229 scoped_ptr<FtpAuthCache> ftp_auth_cache_; 237 scoped_ptr<FtpAuthCache> ftp_auth_cache_;
230 std::string accept_language_; 238 std::string accept_language_;
231 std::string accept_charset_; 239 std::string accept_charset_;
232 // The charset of the referrer where this request comes from. It's not 240 // 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 241 // used in communication with a server but is used to construct a suggested
234 // filename for file download. 242 // filename for file download.
235 std::string referrer_charset_; 243 std::string referrer_charset_;
236 HttpTransactionFactory* http_transaction_factory_; 244 HttpTransactionFactory* http_transaction_factory_;
237 FtpTransactionFactory* ftp_transaction_factory_; 245 FtpTransactionFactory* ftp_transaction_factory_;
238 const URLRequestJobFactory* job_factory_; 246 const URLRequestJobFactory* job_factory_;
247 URLRequestThrottlerManager* throttler_manager_;
239 248
240 // --------------------------------------------------------------------------- 249 // ---------------------------------------------------------------------------
241 // Important: When adding any new members below, consider whether they need to 250 // Important: When adding any new members below, consider whether they need to
242 // be added to CopyFrom. 251 // be added to CopyFrom.
243 // --------------------------------------------------------------------------- 252 // ---------------------------------------------------------------------------
244 253
245 scoped_ptr<std::set<const URLRequest*> > url_requests_; 254 scoped_ptr<std::set<const URLRequest*> > url_requests_;
246 255
247 DISALLOW_COPY_AND_ASSIGN(URLRequestContext); 256 DISALLOW_COPY_AND_ASSIGN(URLRequestContext);
248 }; 257 };
249 258
250 } // namespace net 259 } // namespace net
251 260
252 #endif // NET_URL_REQUEST_URL_REQUEST_CONTEXT_H_ 261 #endif // NET_URL_REQUEST_URL_REQUEST_CONTEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698