| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #pragma once | 12 #pragma once |
| 13 | 13 |
| 14 #include "base/non_thread_safe.h" | 14 #include "base/non_thread_safe.h" |
| 15 #include "base/ref_counted.h" | 15 #include "base/ref_counted.h" |
| 16 #include "base/string_util.h" | |
| 17 #include "net/base/cookie_store.h" | 16 #include "net/base/cookie_store.h" |
| 18 #include "net/base/host_resolver.h" | 17 #include "net/base/host_resolver.h" |
| 19 #include "net/base/net_log.h" | 18 #include "net/base/net_log.h" |
| 20 #include "net/base/ssl_config_service.h" | 19 #include "net/base/ssl_config_service.h" |
| 21 #include "net/base/transport_security_state.h" | 20 #include "net/base/transport_security_state.h" |
| 22 #include "net/ftp/ftp_auth_cache.h" | 21 #include "net/ftp/ftp_auth_cache.h" |
| 23 #include "net/proxy/proxy_service.h" | 22 #include "net/proxy/proxy_service.h" |
| 24 | 23 |
| 25 namespace net { | 24 namespace net { |
| 26 class CookiePolicy; | 25 class CookiePolicy; |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 | 96 |
| 98 // Gets the value of 'Accept-Charset' header field. | 97 // Gets the value of 'Accept-Charset' header field. |
| 99 const std::string& accept_charset() const { return accept_charset_; } | 98 const std::string& accept_charset() const { return accept_charset_; } |
| 100 | 99 |
| 101 // Gets the value of 'Accept-Language' header field. | 100 // Gets the value of 'Accept-Language' header field. |
| 102 const std::string& accept_language() const { return accept_language_; } | 101 const std::string& accept_language() const { return accept_language_; } |
| 103 | 102 |
| 104 // Gets the UA string to use for the given URL. Pass an invalid URL (such as | 103 // Gets the UA string to use for the given URL. Pass an invalid URL (such as |
| 105 // GURL()) to get the default UA string. Subclasses should override this | 104 // GURL()) to get the default UA string. Subclasses should override this |
| 106 // method to provide a UA string. | 105 // method to provide a UA string. |
| 107 virtual const std::string& GetUserAgent(const GURL& url) const { | 106 virtual const std::string& GetUserAgent(const GURL& url) const; |
| 108 return EmptyString(); | |
| 109 } | |
| 110 | 107 |
| 111 // In general, referrer_charset is not known when URLRequestContext is | 108 // In general, referrer_charset is not known when URLRequestContext is |
| 112 // constructed. So, we need a setter. | 109 // constructed. So, we need a setter. |
| 113 const std::string& referrer_charset() const { return referrer_charset_; } | 110 const std::string& referrer_charset() const { return referrer_charset_; } |
| 114 void set_referrer_charset(const std::string& charset) { | 111 void set_referrer_charset(const std::string& charset) { |
| 115 referrer_charset_ = charset; | 112 referrer_charset_ = charset; |
| 116 } | 113 } |
| 117 | 114 |
| 118 protected: | 115 protected: |
| 119 friend class base::RefCountedThreadSafe<URLRequestContext>; | 116 friend class base::RefCountedThreadSafe<URLRequestContext>; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 139 // The charset of the referrer where this request comes from. It's not | 136 // The charset of the referrer where this request comes from. It's not |
| 140 // used in communication with a server but is used to construct a suggested | 137 // used in communication with a server but is used to construct a suggested |
| 141 // filename for file download. | 138 // filename for file download. |
| 142 std::string referrer_charset_; | 139 std::string referrer_charset_; |
| 143 | 140 |
| 144 private: | 141 private: |
| 145 DISALLOW_COPY_AND_ASSIGN(URLRequestContext); | 142 DISALLOW_COPY_AND_ASSIGN(URLRequestContext); |
| 146 }; | 143 }; |
| 147 | 144 |
| 148 #endif // NET_URL_REQUEST_URL_REQUEST_CONTEXT_H_ | 145 #endif // NET_URL_REQUEST_URL_REQUEST_CONTEXT_H_ |
| OLD | NEW |