| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #include "chrome/browser/net/chrome_url_request_context.h" | 5 #include "chrome/browser/net/chrome_url_request_context.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/privacy_blacklist/blacklist.h" | 10 #include "chrome/browser/privacy_blacklist/blacklist.h" |
| (...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 749 http_transaction_factory_ = other->http_transaction_factory_; | 749 http_transaction_factory_ = other->http_transaction_factory_; |
| 750 ftp_transaction_factory_ = other->ftp_transaction_factory_; | 750 ftp_transaction_factory_ = other->ftp_transaction_factory_; |
| 751 cookie_store_ = other->cookie_store_; | 751 cookie_store_ = other->cookie_store_; |
| 752 cookie_policy_.set_type(other->cookie_policy_.type()); | 752 cookie_policy_.set_type(other->cookie_policy_.type()); |
| 753 strict_transport_security_state_ = other->strict_transport_security_state_; | 753 strict_transport_security_state_ = other->strict_transport_security_state_; |
| 754 accept_language_ = other->accept_language_; | 754 accept_language_ = other->accept_language_; |
| 755 accept_charset_ = other->accept_charset_; | 755 accept_charset_ = other->accept_charset_; |
| 756 referrer_charset_ = other->referrer_charset_; | 756 referrer_charset_ = other->referrer_charset_; |
| 757 | 757 |
| 758 // Set ChromeURLRequestContext members | 758 // Set ChromeURLRequestContext members |
| 759 appcache_service_ = other->appcache_service_; | |
| 760 blacklist_manager_ = other->blacklist_manager_; | |
| 761 extension_paths_ = other->extension_paths_; | 759 extension_paths_ = other->extension_paths_; |
| 762 user_script_dir_path_ = other->user_script_dir_path_; | 760 user_script_dir_path_ = other->user_script_dir_path_; |
| 761 appcache_service_ = other->appcache_service_; |
| 762 host_zoom_map_ = other->host_zoom_map_; |
| 763 blacklist_manager_ = other->blacklist_manager_; |
| 763 is_media_ = other->is_media_; | 764 is_media_ = other->is_media_; |
| 764 is_off_the_record_ = other->is_off_the_record_; | 765 is_off_the_record_ = other->is_off_the_record_; |
| 765 } | 766 } |
| 766 | 767 |
| 767 void ChromeURLRequestContext::set_blacklist_manager( | 768 void ChromeURLRequestContext::set_blacklist_manager( |
| 768 BlacklistManager* blacklist_manager) { | 769 BlacklistManager* blacklist_manager) { |
| 769 blacklist_manager_ = blacklist_manager; | 770 blacklist_manager_ = blacklist_manager; |
| 770 } | 771 } |
| 771 | 772 |
| 772 void ChromeURLRequestContext::OnAcceptLanguageChange( | 773 void ChromeURLRequestContext::OnAcceptLanguageChange( |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 822 // For the latter, we need a change on the webkit-side. | 823 // For the latter, we need a change on the webkit-side. |
| 823 // We initialize it to the default charset here and a user will | 824 // We initialize it to the default charset here and a user will |
| 824 // have an *arguably* better default charset for interpreting a raw 8bit | 825 // have an *arguably* better default charset for interpreting a raw 8bit |
| 825 // C-D header field. It means the native OS codepage fallback in | 826 // C-D header field. It means the native OS codepage fallback in |
| 826 // net_util::GetSuggestedFilename is unlikely to be taken. | 827 // net_util::GetSuggestedFilename is unlikely to be taken. |
| 827 referrer_charset_ = default_charset; | 828 referrer_charset_ = default_charset; |
| 828 | 829 |
| 829 cookie_policy_type_ = net::CookiePolicy::FromInt( | 830 cookie_policy_type_ = net::CookiePolicy::FromInt( |
| 830 prefs->GetInteger(prefs::kCookieBehavior)); | 831 prefs->GetInteger(prefs::kCookieBehavior)); |
| 831 | 832 |
| 833 host_zoom_map_ = profile->GetHostZoomMap(); |
| 834 |
| 832 blacklist_manager_ = profile->GetBlacklistManager(); | 835 blacklist_manager_ = profile->GetBlacklistManager(); |
| 833 | 836 |
| 834 // TODO(eroman): this doesn't look safe; sharing between IO and UI threads! | 837 // TODO(eroman): this doesn't look safe; sharing between IO and UI threads! |
| 835 strict_transport_security_state_ = profile->GetStrictTransportSecurityState(); | 838 strict_transport_security_state_ = profile->GetStrictTransportSecurityState(); |
| 836 | 839 |
| 837 if (profile->GetExtensionsService()) { | 840 if (profile->GetExtensionsService()) { |
| 838 const ExtensionList* extensions = | 841 const ExtensionList* extensions = |
| 839 profile->GetExtensionsService()->extensions(); | 842 profile->GetExtensionsService()->extensions(); |
| 840 for (ExtensionList::const_iterator iter = extensions->begin(); | 843 for (ExtensionList::const_iterator iter = extensions->begin(); |
| 841 iter != extensions->end(); ++iter) { | 844 iter != extensions->end(); ++iter) { |
| 842 extension_paths_[(*iter)->id()] = (*iter)->path(); | 845 extension_paths_[(*iter)->id()] = (*iter)->path(); |
| 843 } | 846 } |
| 844 } | 847 } |
| 845 | 848 |
| 846 if (profile->GetUserScriptMaster()) | 849 if (profile->GetUserScriptMaster()) |
| 847 user_script_dir_path_ = profile->GetUserScriptMaster()->user_script_dir(); | 850 user_script_dir_path_ = profile->GetUserScriptMaster()->user_script_dir(); |
| 848 | 851 |
| 849 // TODO(eroman): this doesn't look safe; sharing between IO and UI threads! | |
| 850 ssl_config_service_ = profile->GetSSLConfigService(); | 852 ssl_config_service_ = profile->GetSSLConfigService(); |
| 851 | 853 |
| 852 profile_dir_path_ = profile->GetPath(); | 854 profile_dir_path_ = profile->GetPath(); |
| 853 } | 855 } |
| 854 | 856 |
| 855 ChromeURLRequestContextFactory::~ChromeURLRequestContextFactory() { | 857 ChromeURLRequestContextFactory::~ChromeURLRequestContextFactory() { |
| 856 CheckCurrentlyOnIOThread(); | 858 CheckCurrentlyOnIOThread(); |
| 857 } | 859 } |
| 858 | 860 |
| 859 void ChromeURLRequestContextFactory::ApplyProfileParametersToContext( | 861 void ChromeURLRequestContextFactory::ApplyProfileParametersToContext( |
| 860 ChromeURLRequestContext* context) { | 862 ChromeURLRequestContext* context) { |
| 861 // Apply all the parameters. NOTE: keep this in sync with | 863 // Apply all the parameters. NOTE: keep this in sync with |
| 862 // ChromeURLRequestContextFactory(Profile*). | 864 // ChromeURLRequestContextFactory(Profile*). |
| 863 context->set_is_media(is_media_); | 865 context->set_is_media(is_media_); |
| 864 context->set_is_off_the_record(is_off_the_record_); | 866 context->set_is_off_the_record(is_off_the_record_); |
| 865 context->set_accept_language(accept_language_); | 867 context->set_accept_language(accept_language_); |
| 866 context->set_accept_charset(accept_charset_); | 868 context->set_accept_charset(accept_charset_); |
| 867 context->set_referrer_charset(referrer_charset_); | 869 context->set_referrer_charset(referrer_charset_); |
| 868 context->set_cookie_policy_type(cookie_policy_type_); | 870 context->set_cookie_policy_type(cookie_policy_type_); |
| 869 context->set_extension_paths(extension_paths_); | 871 context->set_extension_paths(extension_paths_); |
| 870 context->set_user_script_dir_path(user_script_dir_path_); | 872 context->set_user_script_dir_path(user_script_dir_path_); |
| 873 context->set_host_zoom_map(host_zoom_map_); |
| 871 context->set_blacklist_manager(blacklist_manager_.get()); | 874 context->set_blacklist_manager(blacklist_manager_.get()); |
| 872 context->set_strict_transport_security_state( | 875 context->set_strict_transport_security_state( |
| 873 strict_transport_security_state_); | 876 strict_transport_security_state_); |
| 874 context->set_ssl_config_service(ssl_config_service_); | 877 context->set_ssl_config_service(ssl_config_service_); |
| 875 } | 878 } |
| 876 | 879 |
| 877 // ---------------------------------------------------------------------------- | 880 // ---------------------------------------------------------------------------- |
| 878 | 881 |
| 879 net::ProxyConfig* CreateProxyConfig(const CommandLine& command_line) { | 882 net::ProxyConfig* CreateProxyConfig(const CommandLine& command_line) { |
| 880 // Scan for all "enable" type proxy switches. | 883 // Scan for all "enable" type proxy switches. |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 926 } | 929 } |
| 927 | 930 |
| 928 if (command_line.HasSwitch(switches::kProxyBypassList)) { | 931 if (command_line.HasSwitch(switches::kProxyBypassList)) { |
| 929 proxy_config->ParseNoProxyList( | 932 proxy_config->ParseNoProxyList( |
| 930 WideToASCII(command_line.GetSwitchValue( | 933 WideToASCII(command_line.GetSwitchValue( |
| 931 switches::kProxyBypassList))); | 934 switches::kProxyBypassList))); |
| 932 } | 935 } |
| 933 | 936 |
| 934 return proxy_config; | 937 return proxy_config; |
| 935 } | 938 } |
| OLD | NEW |