| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef NET_PROXY_SCRIPT_DECIDER_H | 5 #ifndef NET_PROXY_SCRIPT_DECIDER_H |
| 6 #define NET_PROXY_SCRIPT_DECIDER_H | 6 #define NET_PROXY_SCRIPT_DECIDER_H |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 // amount of time before getting started. | 62 // amount of time before getting started. |
| 63 // On successful completion, the "effective" proxy settings we ended up | 63 // On successful completion, the "effective" proxy settings we ended up |
| 64 // deciding on will be available vial the effective_settings() accessor. | 64 // deciding on will be available vial the effective_settings() accessor. |
| 65 // Note that this may differ from |config| since we will have stripped any | 65 // Note that this may differ from |config| since we will have stripped any |
| 66 // manual settings, and decided whether to use auto-detect or the custom PAC | 66 // manual settings, and decided whether to use auto-detect or the custom PAC |
| 67 // URL. Finally, if auto-detect was used we may now have resolved that to a | 67 // URL. Finally, if auto-detect was used we may now have resolved that to a |
| 68 // specific script URL. | 68 // specific script URL. |
| 69 int Start(const ProxyConfig& config, | 69 int Start(const ProxyConfig& config, |
| 70 const base::TimeDelta wait_delay, | 70 const base::TimeDelta wait_delay, |
| 71 bool fetch_pac_bytes, | 71 bool fetch_pac_bytes, |
| 72 OldCompletionCallback* callback); | 72 const net::CompletionCallback& callback); |
| 73 | 73 |
| 74 const ProxyConfig& effective_config() const; | 74 const ProxyConfig& effective_config() const; |
| 75 | 75 |
| 76 // TODO(eroman): Return a const-pointer. | 76 // TODO(eroman): Return a const-pointer. |
| 77 ProxyResolverScriptData* script_data() const; | 77 ProxyResolverScriptData* script_data() const; |
| 78 | 78 |
| 79 private: | 79 private: |
| 80 // Represents the sources from which we can get PAC files; two types of | 80 // Represents the sources from which we can get PAC files; two types of |
| 81 // auto-detect or a custom URL. | 81 // auto-detect or a custom URL. |
| 82 struct PacSource { | 82 struct PacSource { |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 const PacSource& current_pac_source() const; | 138 const PacSource& current_pac_source() const; |
| 139 | 139 |
| 140 void OnWaitTimerFired(); | 140 void OnWaitTimerFired(); |
| 141 void DidComplete(); | 141 void DidComplete(); |
| 142 void Cancel(); | 142 void Cancel(); |
| 143 | 143 |
| 144 ProxyResolver* resolver_; | 144 ProxyResolver* resolver_; |
| 145 ProxyScriptFetcher* proxy_script_fetcher_; | 145 ProxyScriptFetcher* proxy_script_fetcher_; |
| 146 DhcpProxyScriptFetcher* dhcp_proxy_script_fetcher_; | 146 DhcpProxyScriptFetcher* dhcp_proxy_script_fetcher_; |
| 147 | 147 |
| 148 OldCompletionCallbackImpl<ProxyScriptDecider> io_callback_; | 148 net::CompletionCallback callback_; |
| 149 OldCompletionCallback* user_callback_; | |
| 150 | 149 |
| 151 size_t current_pac_source_index_; | 150 size_t current_pac_source_index_; |
| 152 | 151 |
| 153 // Filled when the PAC script fetch completes. | 152 // Filled when the PAC script fetch completes. |
| 154 string16 pac_script_; | 153 string16 pac_script_; |
| 155 | 154 |
| 156 // Flag indicating whether the caller requested a mandatory pac script | 155 // Flag indicating whether the caller requested a mandatory pac script |
| 157 // (i.e. fallback to direct connections are prohibited). | 156 // (i.e. fallback to direct connections are prohibited). |
| 158 bool pac_mandatory_; | 157 bool pac_mandatory_; |
| 159 | 158 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 171 ProxyConfig effective_config_; | 170 ProxyConfig effective_config_; |
| 172 scoped_refptr<ProxyResolverScriptData> script_data_; | 171 scoped_refptr<ProxyResolverScriptData> script_data_; |
| 173 | 172 |
| 174 | 173 |
| 175 DISALLOW_COPY_AND_ASSIGN(ProxyScriptDecider); | 174 DISALLOW_COPY_AND_ASSIGN(ProxyScriptDecider); |
| 176 }; | 175 }; |
| 177 | 176 |
| 178 } // namespace net | 177 } // namespace net |
| 179 | 178 |
| 180 #endif // NET_PROXY_SCRIPT_DECIDER_H | 179 #endif // NET_PROXY_SCRIPT_DECIDER_H |
| OLD | NEW |