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_network_session.h" | |
23 #include "net/http/http_server_properties.h" | 24 #include "net/http/http_server_properties.h" |
24 #include "net/ftp/ftp_auth_cache.h" | 25 #include "net/ftp/ftp_auth_cache.h" |
25 #include "net/url_request/url_request.h" | 26 #include "net/url_request/url_request.h" |
26 | 27 |
27 namespace net { | 28 namespace net { |
28 class CertVerifier; | 29 class CertVerifier; |
29 class CookieStore; | 30 class CookieStore; |
30 class FraudulentCertificateReporter; | 31 class FraudulentCertificateReporter; |
31 class FtpTransactionFactory; | 32 class FtpTransactionFactory; |
32 class HostResolver; | 33 class HostResolver; |
(...skipping 12 matching lines...) Expand all Loading... | |
45 // shared, URLRequestContextStorage can be helpful in defining their storage. | 46 // shared, URLRequestContextStorage can be helpful in defining their storage. |
46 class NET_EXPORT URLRequestContext | 47 class NET_EXPORT URLRequestContext |
47 : NON_EXPORTED_BASE(public base::NonThreadSafe) { | 48 : NON_EXPORTED_BASE(public base::NonThreadSafe) { |
48 public: | 49 public: |
49 URLRequestContext(); | 50 URLRequestContext(); |
50 virtual ~URLRequestContext(); | 51 virtual ~URLRequestContext(); |
51 | 52 |
52 // Copies the state from |other| into this context. | 53 // Copies the state from |other| into this context. |
53 void CopyFrom(const URLRequestContext* other); | 54 void CopyFrom(const URLRequestContext* other); |
54 | 55 |
56 // If this context has an associated network session, populate params from the | |
57 // network session and return true. | |
58 bool GetReferenceParams(HttpNetworkSession::Params* params) const; | |
mmenke
2012/09/04 17:43:13
Is a copy really necessary? Seems like we could j
mmenke
2012/09/04 17:43:13
Suggest calling this GetNetworkSessionParams, sinc
szager1
2012/09/04 19:31:07
The problem is that the URLRequestContext may not
szager1
2012/09/04 19:31:07
Done.
mmenke
2012/09/04 19:35:40
I was thinking something more along the lines of:
| |
59 | |
55 URLRequest* CreateRequest( | 60 URLRequest* CreateRequest( |
56 const GURL& url, URLRequest::Delegate* delegate) const; | 61 const GURL& url, URLRequest::Delegate* delegate) const; |
57 | 62 |
58 NetLog* net_log() const { | 63 NetLog* net_log() const { |
59 return net_log_; | 64 return net_log_; |
60 } | 65 } |
61 | 66 |
62 void set_net_log(NetLog* net_log) { | 67 void set_net_log(NetLog* net_log) { |
63 net_log_ = net_log; | 68 net_log_ = net_log; |
64 } | 69 } |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
253 // --------------------------------------------------------------------------- | 258 // --------------------------------------------------------------------------- |
254 | 259 |
255 scoped_ptr<std::set<const URLRequest*> > url_requests_; | 260 scoped_ptr<std::set<const URLRequest*> > url_requests_; |
256 | 261 |
257 DISALLOW_COPY_AND_ASSIGN(URLRequestContext); | 262 DISALLOW_COPY_AND_ASSIGN(URLRequestContext); |
258 }; | 263 }; |
259 | 264 |
260 } // namespace net | 265 } // namespace net |
261 | 266 |
262 #endif // NET_URL_REQUEST_URL_REQUEST_CONTEXT_H_ | 267 #endif // NET_URL_REQUEST_URL_REQUEST_CONTEXT_H_ |
OLD | NEW |