13f50c38dc070f4bb515c1b64450dae14f316474eKristian Monsen// Copyright (c) 2011 The Chromium Authors. All rights reserved.
2c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott// Use of this source code is governed by a BSD-style license that can be
3c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott// found in the LICENSE file.
4c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott
5c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott// This class represents contextual information (cookies, cache, etc.)
6c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott// that's useful when processing resource requests.
7c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott// The class is reference-counted so that it can be cleaned up after any
8c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott// requests that are using it have been completed.
9c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott
10c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott#ifndef NET_URL_REQUEST_URL_REQUEST_CONTEXT_H_
11c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott#define NET_URL_REQUEST_URL_REQUEST_CONTEXT_H_
123345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick#pragma once
13c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott
14ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen#include "base/memory/ref_counted.h"
153f50c38dc070f4bb515c1b64450dae14f316474eKristian Monsen#include "base/threading/non_thread_safe.h"
162557749644f9d25af9721533322db19197c49b49Kristian Monsen#include "net/base/net_export.h"
17c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch#include "net/base/net_log.h"
18c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott#include "net/base/ssl_config_service.h"
19c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott#include "net/base/transport_security_state.h"
20c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott#include "net/ftp/ftp_auth_cache.h"
21c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott#include "net/proxy/proxy_service.h"
22201ade2fbba22bfb27ae029f4d23fca6ded109a0Ben Murdoch#include "net/socket/dns_cert_provenance_checker.h"
23c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott
24c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scottnamespace net {
2521d179b334e59e9a3bfcaed4c4430bef1bc5759dKristian Monsenclass CertVerifier;
26c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scottclass CookiePolicy;
273345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrickclass CookieStore;
28201ade2fbba22bfb27ae029f4d23fca6ded109a0Ben Murdochclass DnsCertProvenanceChecker;
29731df977c0511bca2206b5f333555b1205ff1f43Iain Merrickclass DnsRRResolver;
30c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scottclass FtpTransactionFactory;
313345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrickclass HostResolver;
32c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdochclass HttpAuthHandlerFactory;
33c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scottclass HttpTransactionFactory;
34dc0f95d653279beabeb9817299e2902918ba123eKristian Monsenclass NetworkDelegate;
353345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrickclass SSLConfigService;
36c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scottclass URLRequest;
37c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott
383f50c38dc070f4bb515c1b64450dae14f316474eKristian Monsen// Subclass to provide application-specific context for URLRequest
39dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen// instances. Note that URLRequestContext typically does not provide storage for
40dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen// these member variables, since they may be shared. For the ones that aren't
41dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen// shared, URLRequestContextStorage can be helpful in defining their storage.
422557749644f9d25af9721533322db19197c49b49Kristian Monsenclass NET_EXPORT URLRequestContext
43c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch    : public base::RefCountedThreadSafe<URLRequestContext>,
443f50c38dc070f4bb515c1b64450dae14f316474eKristian Monsen      public base::NonThreadSafe {
45c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott public:
463345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick  URLRequestContext();
47c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott
48ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen  // Copies the state from |other| into this context.
49ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen  void CopyFrom(URLRequestContext* other);
50ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen
513f50c38dc070f4bb515c1b64450dae14f316474eKristian Monsen  NetLog* net_log() const {
52c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch    return net_log_;
53c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch  }
54c407dc5cd9bdc5668497f21b26b09d988ab439deBen Murdoch
553f50c38dc070f4bb515c1b64450dae14f316474eKristian Monsen  void set_net_log(NetLog* net_log) {
5621d179b334e59e9a3bfcaed4c4430bef1bc5759dKristian Monsen    net_log_ = net_log;
5721d179b334e59e9a3bfcaed4c4430bef1bc5759dKristian Monsen  }
5821d179b334e59e9a3bfcaed4c4430bef1bc5759dKristian Monsen
593f50c38dc070f4bb515c1b64450dae14f316474eKristian Monsen  HostResolver* host_resolver() const {
60c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott    return host_resolver_;
61c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott  }
62c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott
633f50c38dc070f4bb515c1b64450dae14f316474eKristian Monsen  void set_host_resolver(HostResolver* host_resolver) {
6421d179b334e59e9a3bfcaed4c4430bef1bc5759dKristian Monsen    host_resolver_ = host_resolver;
6521d179b334e59e9a3bfcaed4c4430bef1bc5759dKristian Monsen  }
6621d179b334e59e9a3bfcaed4c4430bef1bc5759dKristian Monsen
673f50c38dc070f4bb515c1b64450dae14f316474eKristian Monsen  CertVerifier* cert_verifier() const {
6821d179b334e59e9a3bfcaed4c4430bef1bc5759dKristian Monsen    return cert_verifier_;
6921d179b334e59e9a3bfcaed4c4430bef1bc5759dKristian Monsen  }
7021d179b334e59e9a3bfcaed4c4430bef1bc5759dKristian Monsen
713f50c38dc070f4bb515c1b64450dae14f316474eKristian Monsen  void set_cert_verifier(CertVerifier* cert_verifier) {
7221d179b334e59e9a3bfcaed4c4430bef1bc5759dKristian Monsen    cert_verifier_ = cert_verifier;
7321d179b334e59e9a3bfcaed4c4430bef1bc5759dKristian Monsen  }
7421d179b334e59e9a3bfcaed4c4430bef1bc5759dKristian Monsen
753f50c38dc070f4bb515c1b64450dae14f316474eKristian Monsen  DnsRRResolver* dnsrr_resolver() const {
76731df977c0511bca2206b5f333555b1205ff1f43Iain Merrick    return dnsrr_resolver_;
77731df977c0511bca2206b5f333555b1205ff1f43Iain Merrick  }
78731df977c0511bca2206b5f333555b1205ff1f43Iain Merrick
793f50c38dc070f4bb515c1b64450dae14f316474eKristian Monsen  void set_dnsrr_resolver(DnsRRResolver* dnsrr_resolver) {
8021d179b334e59e9a3bfcaed4c4430bef1bc5759dKristian Monsen    dnsrr_resolver_ = dnsrr_resolver;
8121d179b334e59e9a3bfcaed4c4430bef1bc5759dKristian Monsen  }
8221d179b334e59e9a3bfcaed4c4430bef1bc5759dKristian Monsen
833f50c38dc070f4bb515c1b64450dae14f316474eKristian Monsen  DnsCertProvenanceChecker* dns_cert_checker() const {
84dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen    return dns_cert_checker_;
85201ade2fbba22bfb27ae029f4d23fca6ded109a0Ben Murdoch  }
86ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen  void set_dns_cert_checker(DnsCertProvenanceChecker* dns_cert_checker) {
87dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen    dns_cert_checker_ = dns_cert_checker;
88c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott  }
89c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott
90dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen  // Get the proxy service for this context.
91dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen  ProxyService* proxy_service() const { return proxy_service_; }
923f50c38dc070f4bb515c1b64450dae14f316474eKristian Monsen  void set_proxy_service(ProxyService* proxy_service) {
9321d179b334e59e9a3bfcaed4c4430bef1bc5759dKristian Monsen    proxy_service_ = proxy_service;
9421d179b334e59e9a3bfcaed4c4430bef1bc5759dKristian Monsen  }
9521d179b334e59e9a3bfcaed4c4430bef1bc5759dKristian Monsen
96c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott  // Get the ssl config service for this context.
97dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen  SSLConfigService* ssl_config_service() const { return ssl_config_service_; }
98ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen  void set_ssl_config_service(SSLConfigService* service) {
99dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen    ssl_config_service_ = service;
100c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott  }
101c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott
10221d179b334e59e9a3bfcaed4c4430bef1bc5759dKristian Monsen  // Gets the HTTP Authentication Handler Factory for this context.
10321d179b334e59e9a3bfcaed4c4430bef1bc5759dKristian Monsen  // The factory is only valid for the lifetime of this URLRequestContext
1043f50c38dc070f4bb515c1b64450dae14f316474eKristian Monsen  HttpAuthHandlerFactory* http_auth_handler_factory() {
10521d179b334e59e9a3bfcaed4c4430bef1bc5759dKristian Monsen    return http_auth_handler_factory_;
10621d179b334e59e9a3bfcaed4c4430bef1bc5759dKristian Monsen  }
1073f50c38dc070f4bb515c1b64450dae14f316474eKristian Monsen  void set_http_auth_handler_factory(HttpAuthHandlerFactory* factory) {
10821d179b334e59e9a3bfcaed4c4430bef1bc5759dKristian Monsen    http_auth_handler_factory_ = factory;
10921d179b334e59e9a3bfcaed4c4430bef1bc5759dKristian Monsen  }
11021d179b334e59e9a3bfcaed4c4430bef1bc5759dKristian Monsen
111c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott  // Gets the http transaction factory for this context.
1123f50c38dc070f4bb515c1b64450dae14f316474eKristian Monsen  HttpTransactionFactory* http_transaction_factory() const {
113c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott    return http_transaction_factory_;
114c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott  }
1153f50c38dc070f4bb515c1b64450dae14f316474eKristian Monsen  void set_http_transaction_factory(HttpTransactionFactory* factory) {
11621d179b334e59e9a3bfcaed4c4430bef1bc5759dKristian Monsen    http_transaction_factory_ = factory;
11721d179b334e59e9a3bfcaed4c4430bef1bc5759dKristian Monsen  }
11821d179b334e59e9a3bfcaed4c4430bef1bc5759dKristian Monsen
119c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott  // Gets the ftp transaction factory for this context.
1203f50c38dc070f4bb515c1b64450dae14f316474eKristian Monsen  FtpTransactionFactory* ftp_transaction_factory() {
121c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott    return ftp_transaction_factory_;
122c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott  }
123ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen  void set_ftp_transaction_factory(FtpTransactionFactory* factory) {
124dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen    ftp_transaction_factory_ = factory;
125dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen  }
126c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott
127dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen  void set_network_delegate(NetworkDelegate* network_delegate) {
12872a454cd3513ac24fbdd0e0cb9ad70b86a99b801Kristian Monsen    network_delegate_ = network_delegate;
12972a454cd3513ac24fbdd0e0cb9ad70b86a99b801Kristian Monsen  }
130dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen  NetworkDelegate* network_delegate() const { return network_delegate_; }
13172a454cd3513ac24fbdd0e0cb9ad70b86a99b801Kristian Monsen
132c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott  // Gets the cookie store for this context (may be null, in which case
133c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott  // cookies are not stored).
134dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen  CookieStore* cookie_store() const { return cookie_store_.get(); }
1353f50c38dc070f4bb515c1b64450dae14f316474eKristian Monsen  void set_cookie_store(CookieStore* cookie_store);
13621d179b334e59e9a3bfcaed4c4430bef1bc5759dKristian Monsen
137c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott  // Gets the cookie policy for this context (may be null, in which case
138c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott  // cookies are allowed).
139dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen  CookiePolicy* cookie_policy() const { return cookie_policy_; }
140dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen  void set_cookie_policy(CookiePolicy* cookie_policy) {
141dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen    cookie_policy_ = cookie_policy;
142dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen  }
143c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott
144dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen  TransportSecurityState* transport_security_state() const {
145dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen      return transport_security_state_;
146dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen  }
147dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen  void set_transport_security_state(
148ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen      TransportSecurityState* state) {
149dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen    transport_security_state_ = state;
150dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen  }
151c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott
152c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott  // Gets the FTP authentication cache for this context.
1533f50c38dc070f4bb515c1b64450dae14f316474eKristian Monsen  FtpAuthCache* ftp_auth_cache() { return &ftp_auth_cache_; }
154c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott
155c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott  // Gets the value of 'Accept-Charset' header field.
156c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott  const std::string& accept_charset() const { return accept_charset_; }
157dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen  void set_accept_charset(const std::string& accept_charset) {
158dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen    accept_charset_ = accept_charset;
159dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen  }
160c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott
161c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott  // Gets the value of 'Accept-Language' header field.
162ba160cd4054d13d0cb0b1b46e61c3bed67095811Kristian Monsen#ifdef ANDROID
163ba160cd4054d13d0cb0b1b46e61c3bed67095811Kristian Monsen  virtual
1641166dab4e90689c7d1202e95c9cbdf761908e67fKristian Monsen#endif
165ba160cd4054d13d0cb0b1b46e61c3bed67095811Kristian Monsen  const std::string& accept_language() const { return accept_language_; }
166c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott
167dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen  void set_accept_language(const std::string& accept_language) {
168dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen    accept_language_ = accept_language;
169dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen  }
170dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen
171c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott  // Gets the UA string to use for the given URL.  Pass an invalid URL (such as
172c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott  // GURL()) to get the default UA string.  Subclasses should override this
173c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott  // method to provide a UA string.
1743345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick  virtual const std::string& GetUserAgent(const GURL& url) const;
175c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott
176c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott  // In general, referrer_charset is not known when URLRequestContext is
177c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott  // constructed. So, we need a setter.
178c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott  const std::string& referrer_charset() const { return referrer_charset_; }
179c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott  void set_referrer_charset(const std::string& charset) {
180c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott    referrer_charset_ = charset;
181c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott  }
182c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott
183731df977c0511bca2206b5f333555b1205ff1f43Iain Merrick  // Controls whether or not the URLRequestContext considers itself to be the
184731df977c0511bca2206b5f333555b1205ff1f43Iain Merrick  // "main" URLRequestContext.
185731df977c0511bca2206b5f333555b1205ff1f43Iain Merrick  bool is_main() const { return is_main_; }
186731df977c0511bca2206b5f333555b1205ff1f43Iain Merrick  void set_is_main(bool is_main) { is_main_ = is_main; }
187731df977c0511bca2206b5f333555b1205ff1f43Iain Merrick
188ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen  // Is SNI available in this request context?
189ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen  bool IsSNIAvailable() const;
190ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen
191e14dcc5a172cad1c4716af7ab94121a73c0c698eAshish Sharma#ifdef ANDROID
192e14dcc5a172cad1c4716af7ab94121a73c0c698eAshish Sharma  // Gets the UID of the calling process
193e14dcc5a172cad1c4716af7ab94121a73c0c698eAshish Sharma  bool getUID(uid_t *uid) const;
194e14dcc5a172cad1c4716af7ab94121a73c0c698eAshish Sharma  void setUID(uid_t uid);
195e14dcc5a172cad1c4716af7ab94121a73c0c698eAshish Sharma#endif
196e14dcc5a172cad1c4716af7ab94121a73c0c698eAshish Sharma
197c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott protected:
198c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott  friend class base::RefCountedThreadSafe<URLRequestContext>;
199c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott
2003345a6884c488ff3a535c2c9acdd33d74b37e311Iain Merrick  virtual ~URLRequestContext();
201c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott
202dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen private:
203ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen  // ---------------------------------------------------------------------------
204ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen  // Important: When adding any new members below, consider whether they need to
205ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen  // be added to CopyFrom.
206ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen  // ---------------------------------------------------------------------------
207ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen
208dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen  // Indicates whether or not this is the main URLRequestContext.
209dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen  bool is_main_;
210dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen
211dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen  // Ownership for these members are not defined here. Clients should either
212dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen  // provide storage elsewhere or have a subclass take ownership.
2133f50c38dc070f4bb515c1b64450dae14f316474eKristian Monsen  NetLog* net_log_;
2143f50c38dc070f4bb515c1b64450dae14f316474eKristian Monsen  HostResolver* host_resolver_;
2153f50c38dc070f4bb515c1b64450dae14f316474eKristian Monsen  CertVerifier* cert_verifier_;
2163f50c38dc070f4bb515c1b64450dae14f316474eKristian Monsen  DnsRRResolver* dnsrr_resolver_;
217dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen  DnsCertProvenanceChecker* dns_cert_checker_;
218dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen  HttpAuthHandlerFactory* http_auth_handler_factory_;
2193f50c38dc070f4bb515c1b64450dae14f316474eKristian Monsen  scoped_refptr<ProxyService> proxy_service_;
2203f50c38dc070f4bb515c1b64450dae14f316474eKristian Monsen  scoped_refptr<SSLConfigService> ssl_config_service_;
221dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen  NetworkDelegate* network_delegate_;
2223f50c38dc070f4bb515c1b64450dae14f316474eKristian Monsen  scoped_refptr<CookieStore> cookie_store_;
2233f50c38dc070f4bb515c1b64450dae14f316474eKristian Monsen  CookiePolicy* cookie_policy_;
2243f50c38dc070f4bb515c1b64450dae14f316474eKristian Monsen  scoped_refptr<TransportSecurityState> transport_security_state_;
2253f50c38dc070f4bb515c1b64450dae14f316474eKristian Monsen  FtpAuthCache ftp_auth_cache_;
226c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott  std::string accept_language_;
227c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott  std::string accept_charset_;
228c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott  // The charset of the referrer where this request comes from. It's not
229c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott  // used in communication with a server but is used to construct a suggested
230c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott  // filename for file download.
231c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott  std::string referrer_charset_;
232c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott
233dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen  HttpTransactionFactory* http_transaction_factory_;
234dc0f95d653279beabeb9817299e2902918ba123eKristian Monsen  FtpTransactionFactory* ftp_transaction_factory_;
235731df977c0511bca2206b5f333555b1205ff1f43Iain Merrick
236ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen  // ---------------------------------------------------------------------------
237ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen  // Important: When adding any new members below, consider whether they need to
238ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen  // be added to CopyFrom.
239ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen  // ---------------------------------------------------------------------------
240ddb351dbec246cf1fab5ec20d2d5520909041de1Kristian Monsen
241e14dcc5a172cad1c4716af7ab94121a73c0c698eAshish Sharma#ifdef ANDROID
242e14dcc5a172cad1c4716af7ab94121a73c0c698eAshish Sharma  bool valid_uid_;
243e14dcc5a172cad1c4716af7ab94121a73c0c698eAshish Sharma  uid_t calling_uid_;
244e14dcc5a172cad1c4716af7ab94121a73c0c698eAshish Sharma#endif
245e14dcc5a172cad1c4716af7ab94121a73c0c698eAshish Sharma
246c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott  DISALLOW_COPY_AND_ASSIGN(URLRequestContext);
247c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott};
248c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott
2493f50c38dc070f4bb515c1b64450dae14f316474eKristian Monsen}  // namespace net
2503f50c38dc070f4bb515c1b64450dae14f316474eKristian Monsen
251c7f5f8508d98d5952d42ed7648c2a8f30a4da156Patrick Scott#endif  // NET_URL_REQUEST_URL_REQUEST_CONTEXT_H_
252