Chromium Code Reviews| 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_ |
| 11 #define NET_URL_REQUEST_URL_REQUEST_CONTEXT_H_ | 11 #define NET_URL_REQUEST_URL_REQUEST_CONTEXT_H_ |
| 12 | 12 |
| 13 #include <set> | 13 #include <set> |
| 14 | 14 |
| 15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
| 17 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
| 18 #include "base/threading/non_thread_safe.h" | 18 #include "base/threading/non_thread_safe.h" |
| 19 #include "net/base/net_export.h" | 19 #include "net/base/net_export.h" |
| 20 #include "net/base/net_log.h" | 20 #include "net/base/net_log.h" |
| 21 #include "net/base/ssl_config_service.h" | 21 #include "net/base/ssl_config_service.h" |
| 22 #include "net/base/transport_security_state.h" | 22 #include "net/base/transport_security_state.h" |
| 23 #include "net/http/http_server_properties.h" | 23 #include "net/http/http_server_properties.h" |
| 24 #include "net/ftp/ftp_auth_cache.h" | 24 #include "net/ftp/ftp_auth_cache.h" |
| 25 #include "net/url_request/url_request.h" | |
|
erikwright (departed)
2012/08/24 08:02:55
forward decl instead.
shalev
2012/08/24 15:36:40
How do I forward declare URLRequest::Delegate?
mmenke
2012/08/24 15:39:09
You can't forward declare inner classes, unfortuna
| |
| 25 | 26 |
| 26 namespace net { | 27 namespace net { |
| 27 class CertVerifier; | 28 class CertVerifier; |
| 28 class CookieStore; | 29 class CookieStore; |
| 29 class FraudulentCertificateReporter; | 30 class FraudulentCertificateReporter; |
| 30 class FtpTransactionFactory; | 31 class FtpTransactionFactory; |
| 31 class HostResolver; | 32 class HostResolver; |
| 32 class HttpAuthHandlerFactory; | 33 class HttpAuthHandlerFactory; |
| 33 class HttpTransactionFactory; | 34 class HttpTransactionFactory; |
| 34 class NetworkDelegate; | 35 class NetworkDelegate; |
| 35 class ServerBoundCertService; | 36 class ServerBoundCertService; |
| 36 class ProxyService; | 37 class ProxyService; |
| 37 class URLRequest; | 38 class URLRequest; |
| 38 class URLRequestJobFactory; | 39 class URLRequestJobFactory; |
| 39 class URLRequestThrottlerManager; | 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 : NON_EXPORTED_BASE(public base::NonThreadSafe) { | 47 : NON_EXPORTED_BASE(public base::NonThreadSafe) { |
| 47 public: | 48 public: |
| 48 URLRequestContext(); | 49 URLRequestContext(); |
| 49 virtual ~URLRequestContext(); | 50 virtual ~URLRequestContext(); |
| 50 | 51 |
| 51 // Copies the state from |other| into this context. | 52 // Copies the state from |other| into this context. |
| 52 void CopyFrom(const URLRequestContext* other); | 53 void CopyFrom(const URLRequestContext* other); |
| 53 | 54 |
| 55 URLRequest* CreateRequest( | |
| 56 const GURL& url, URLRequest::Delegate* delegate) const; | |
| 57 | |
| 54 NetLog* net_log() const { | 58 NetLog* net_log() const { |
| 55 return net_log_; | 59 return net_log_; |
| 56 } | 60 } |
| 57 | 61 |
| 58 void set_net_log(NetLog* net_log) { | 62 void set_net_log(NetLog* net_log) { |
| 59 net_log_ = net_log; | 63 net_log_ = net_log; |
| 60 } | 64 } |
| 61 | 65 |
| 62 HostResolver* host_resolver() const { | 66 HostResolver* host_resolver() const { |
| 63 return host_resolver_; | 67 return host_resolver_; |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 241 // --------------------------------------------------------------------------- | 245 // --------------------------------------------------------------------------- |
| 242 | 246 |
| 243 scoped_ptr<std::set<const URLRequest*> > url_requests_; | 247 scoped_ptr<std::set<const URLRequest*> > url_requests_; |
| 244 | 248 |
| 245 DISALLOW_COPY_AND_ASSIGN(URLRequestContext); | 249 DISALLOW_COPY_AND_ASSIGN(URLRequestContext); |
| 246 }; | 250 }; |
| 247 | 251 |
| 248 } // namespace net | 252 } // namespace net |
| 249 | 253 |
| 250 #endif // NET_URL_REQUEST_URL_REQUEST_CONTEXT_H_ | 254 #endif // NET_URL_REQUEST_URL_REQUEST_CONTEXT_H_ |
| OLD | NEW |