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 #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/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/message_loop_proxy.h" | 9 #include "base/message_loop_proxy.h" |
10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
(...skipping 926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
937 extension_info_ = other->extension_info_; | 937 extension_info_ = other->extension_info_; |
938 user_script_dir_path_ = other->user_script_dir_path_; | 938 user_script_dir_path_ = other->user_script_dir_path_; |
939 appcache_service_ = other->appcache_service_; | 939 appcache_service_ = other->appcache_service_; |
940 database_tracker_ = other->database_tracker_; | 940 database_tracker_ = other->database_tracker_; |
941 chrome_cookie_policy_ = other->chrome_cookie_policy_; | 941 chrome_cookie_policy_ = other->chrome_cookie_policy_; |
942 host_content_settings_map_ = other->host_content_settings_map_; | 942 host_content_settings_map_ = other->host_content_settings_map_; |
943 host_zoom_map_ = other->host_zoom_map_; | 943 host_zoom_map_ = other->host_zoom_map_; |
944 is_media_ = other->is_media_; | 944 is_media_ = other->is_media_; |
945 is_off_the_record_ = other->is_off_the_record_; | 945 is_off_the_record_ = other->is_off_the_record_; |
946 blob_storage_context_ = other->blob_storage_context_; | 946 blob_storage_context_ = other->blob_storage_context_; |
| 947 file_system_host_context_ = other->file_system_host_context_; |
947 } | 948 } |
948 | 949 |
949 void ChromeURLRequestContext::OnAcceptLanguageChange( | 950 void ChromeURLRequestContext::OnAcceptLanguageChange( |
950 const std::string& accept_language) { | 951 const std::string& accept_language) { |
951 CheckCurrentlyOnIOThread(); | 952 CheckCurrentlyOnIOThread(); |
952 accept_language_ = | 953 accept_language_ = |
953 net::HttpUtil::GenerateAcceptLanguageHeader(accept_language); | 954 net::HttpUtil::GenerateAcceptLanguageHeader(accept_language); |
954 } | 955 } |
955 | 956 |
956 void ChromeURLRequestContext::OnDefaultCharsetChange( | 957 void ChromeURLRequestContext::OnDefaultCharsetChange( |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1022 | 1023 |
1023 if (profile->GetUserScriptMaster()) | 1024 if (profile->GetUserScriptMaster()) |
1024 user_script_dir_path_ = profile->GetUserScriptMaster()->user_script_dir(); | 1025 user_script_dir_path_ = profile->GetUserScriptMaster()->user_script_dir(); |
1025 | 1026 |
1026 ssl_config_service_ = profile->GetSSLConfigService(); | 1027 ssl_config_service_ = profile->GetSSLConfigService(); |
1027 profile_dir_path_ = profile->GetPath(); | 1028 profile_dir_path_ = profile->GetPath(); |
1028 cookie_monster_delegate_ = new ChromeCookieMonsterDelegate(profile); | 1029 cookie_monster_delegate_ = new ChromeCookieMonsterDelegate(profile); |
1029 appcache_service_ = profile->GetAppCacheService(); | 1030 appcache_service_ = profile->GetAppCacheService(); |
1030 database_tracker_ = profile->GetDatabaseTracker(); | 1031 database_tracker_ = profile->GetDatabaseTracker(); |
1031 blob_storage_context_ = profile->GetBlobStorageContext(); | 1032 blob_storage_context_ = profile->GetBlobStorageContext(); |
| 1033 file_system_host_context_ = profile->GetFileSystemHostContext(); |
1032 } | 1034 } |
1033 | 1035 |
1034 ChromeURLRequestContextFactory::~ChromeURLRequestContextFactory() { | 1036 ChromeURLRequestContextFactory::~ChromeURLRequestContextFactory() { |
1035 CheckCurrentlyOnIOThread(); | 1037 CheckCurrentlyOnIOThread(); |
1036 } | 1038 } |
1037 | 1039 |
1038 void ChromeURLRequestContextFactory::ApplyProfileParametersToContext( | 1040 void ChromeURLRequestContextFactory::ApplyProfileParametersToContext( |
1039 ChromeURLRequestContext* context) { | 1041 ChromeURLRequestContext* context) { |
1040 // Apply all the parameters. NOTE: keep this in sync with | 1042 // Apply all the parameters. NOTE: keep this in sync with |
1041 // ChromeURLRequestContextFactory(Profile*). | 1043 // ChromeURLRequestContextFactory(Profile*). |
1042 context->set_is_media(is_media_); | 1044 context->set_is_media(is_media_); |
1043 context->set_is_off_the_record(is_off_the_record_); | 1045 context->set_is_off_the_record(is_off_the_record_); |
1044 context->set_accept_language(accept_language_); | 1046 context->set_accept_language(accept_language_); |
1045 context->set_accept_charset(accept_charset_); | 1047 context->set_accept_charset(accept_charset_); |
1046 context->set_referrer_charset(referrer_charset_); | 1048 context->set_referrer_charset(referrer_charset_); |
1047 context->set_extension_info(extension_info_); | 1049 context->set_extension_info(extension_info_); |
1048 context->set_user_script_dir_path(user_script_dir_path_); | 1050 context->set_user_script_dir_path(user_script_dir_path_); |
1049 context->set_host_content_settings_map(host_content_settings_map_); | 1051 context->set_host_content_settings_map(host_content_settings_map_); |
1050 context->set_host_zoom_map(host_zoom_map_); | 1052 context->set_host_zoom_map(host_zoom_map_); |
1051 context->set_transport_security_state( | 1053 context->set_transport_security_state( |
1052 transport_security_state_); | 1054 transport_security_state_); |
1053 context->set_ssl_config_service(ssl_config_service_); | 1055 context->set_ssl_config_service(ssl_config_service_); |
1054 context->set_appcache_service(appcache_service_); | 1056 context->set_appcache_service(appcache_service_); |
1055 context->set_database_tracker(database_tracker_); | 1057 context->set_database_tracker(database_tracker_); |
1056 context->set_blob_storage_context(blob_storage_context_); | 1058 context->set_blob_storage_context(blob_storage_context_); |
| 1059 context->set_file_system_host_context(file_system_host_context_); |
1057 } | 1060 } |
1058 | 1061 |
1059 // ---------------------------------------------------------------------------- | 1062 // ---------------------------------------------------------------------------- |
1060 | 1063 |
1061 net::ProxyConfig* CreateProxyConfig(const PrefService* pref_service) { | 1064 net::ProxyConfig* CreateProxyConfig(const PrefService* pref_service) { |
1062 // Scan for all "enable" type proxy switches. | 1065 // Scan for all "enable" type proxy switches. |
1063 static const char* proxy_prefs[] = { | 1066 static const char* proxy_prefs[] = { |
1064 prefs::kProxyPacUrl, | 1067 prefs::kProxyPacUrl, |
1065 prefs::kProxyServer, | 1068 prefs::kProxyServer, |
1066 prefs::kProxyBypassList, | 1069 prefs::kProxyBypassList, |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1101 prefs::kProxyAutoDetect)); | 1104 prefs::kProxyAutoDetect)); |
1102 | 1105 |
1103 if (pref_service->HasPrefPath(prefs::kProxyBypassList)) { | 1106 if (pref_service->HasPrefPath(prefs::kProxyBypassList)) { |
1104 std::string proxy_bypass = | 1107 std::string proxy_bypass = |
1105 pref_service->GetString(prefs::kProxyBypassList); | 1108 pref_service->GetString(prefs::kProxyBypassList); |
1106 proxy_config->proxy_rules().bypass_rules.ParseFromString(proxy_bypass); | 1109 proxy_config->proxy_rules().bypass_rules.ParseFromString(proxy_bypass); |
1107 } | 1110 } |
1108 | 1111 |
1109 return proxy_config; | 1112 return proxy_config; |
1110 } | 1113 } |
OLD | NEW |