| 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 | 115 |
| 116 // Parse the switch (it should be a positive integer formatted as decimal). | 116 // Parse the switch (it should be a positive integer formatted as decimal). |
| 117 int n; | 117 int n; |
| 118 if (base::StringToInt(s, &n) && n > 0) { | 118 if (base::StringToInt(s, &n) && n > 0) { |
| 119 num_pac_threads = static_cast<size_t>(n); | 119 num_pac_threads = static_cast<size_t>(n); |
| 120 } else { | 120 } else { |
| 121 LOG(ERROR) << "Invalid switch for number of PAC threads: " << s; | 121 LOG(ERROR) << "Invalid switch for number of PAC threads: " << s; |
| 122 } | 122 } |
| 123 } | 123 } |
| 124 | 124 |
| 125 return net::ProxyService::Create( | 125 if (use_v8) { |
| 126 return net::ProxyService::CreateUsingV8ProxyResolver( |
| 127 proxy_config_service, |
| 128 num_pac_threads, |
| 129 context, |
| 130 net_log, |
| 131 io_loop); |
| 132 } |
| 133 |
| 134 return net::ProxyService::CreateUsingSystemProxyResolver( |
| 126 proxy_config_service, | 135 proxy_config_service, |
| 127 use_v8, | |
| 128 num_pac_threads, | 136 num_pac_threads, |
| 129 context, | 137 net_log); |
| 130 net_log, | |
| 131 io_loop); | |
| 132 } | 138 } |
| 133 | 139 |
| 134 // ---------------------------------------------------------------------------- | 140 // ---------------------------------------------------------------------------- |
| 135 // CookieMonster::Delegate implementation | 141 // CookieMonster::Delegate implementation |
| 136 // ---------------------------------------------------------------------------- | 142 // ---------------------------------------------------------------------------- |
| 137 class ChromeCookieMonsterDelegate : public net::CookieMonster::Delegate { | 143 class ChromeCookieMonsterDelegate : public net::CookieMonster::Delegate { |
| 138 public: | 144 public: |
| 139 explicit ChromeCookieMonsterDelegate(Profile* profile) { | 145 explicit ChromeCookieMonsterDelegate(Profile* profile) { |
| 140 CheckCurrentlyOnMainThread(); | 146 CheckCurrentlyOnMainThread(); |
| 141 profile_getter_ = new ProfileGetter(profile); | 147 profile_getter_ = new ProfileGetter(profile); |
| (...skipping 821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 963 prefs::kProxyAutoDetect)); | 969 prefs::kProxyAutoDetect)); |
| 964 | 970 |
| 965 if (pref_service->HasPrefPath(prefs::kProxyBypassList)) { | 971 if (pref_service->HasPrefPath(prefs::kProxyBypassList)) { |
| 966 std::string proxy_bypass = | 972 std::string proxy_bypass = |
| 967 pref_service->GetString(prefs::kProxyBypassList); | 973 pref_service->GetString(prefs::kProxyBypassList); |
| 968 proxy_config->proxy_rules().bypass_rules.ParseFromString(proxy_bypass); | 974 proxy_config->proxy_rules().bypass_rules.ParseFromString(proxy_bypass); |
| 969 } | 975 } |
| 970 | 976 |
| 971 return proxy_config; | 977 return proxy_config; |
| 972 } | 978 } |
| OLD | NEW |