| 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_PROXY_RESOLVER_H_ | 5 #ifndef NET_PROXY_PROXY_RESOLVER_H_ |
| 6 #define NET_PROXY_PROXY_RESOLVER_H_ | 6 #define NET_PROXY_PROXY_RESOLVER_H_ |
| 7 | 7 |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 | 51 |
| 52 // Gets the LoadState for |request|. | 52 // Gets the LoadState for |request|. |
| 53 virtual LoadState GetLoadState(RequestHandle request) const = 0; | 53 virtual LoadState GetLoadState(RequestHandle request) const = 0; |
| 54 | 54 |
| 55 // The PAC script backend can be specified to the ProxyResolver either via | 55 // The PAC script backend can be specified to the ProxyResolver either via |
| 56 // URL, or via the javascript text itself. If |expects_pac_bytes| is true, | 56 // URL, or via the javascript text itself. If |expects_pac_bytes| is true, |
| 57 // then the ProxyResolverScriptData passed to SetPacScript() should | 57 // then the ProxyResolverScriptData passed to SetPacScript() should |
| 58 // contain the actual script bytes rather than just the URL. | 58 // contain the actual script bytes rather than just the URL. |
| 59 bool expects_pac_bytes() const { return expects_pac_bytes_; } | 59 bool expects_pac_bytes() const { return expects_pac_bytes_; } |
| 60 | 60 |
| 61 const std::string& default_my_ip_address() const { |
| 62 return default_my_ip_address_; |
| 63 } |
| 64 void set_default_my_ip_address(const std::string& ip_address) { |
| 65 default_my_ip_address_ = ip_address; |
| 66 } |
| 67 |
| 61 virtual void CancelSetPacScript() = 0; | 68 virtual void CancelSetPacScript() = 0; |
| 62 | 69 |
| 63 // Called to set the PAC script backend to use. | 70 // Called to set the PAC script backend to use. |
| 64 // Returns ERR_IO_PENDING in the case of asynchronous completion, and notifies | 71 // Returns ERR_IO_PENDING in the case of asynchronous completion, and notifies |
| 65 // the result through |callback|. | 72 // the result through |callback|. |
| 66 virtual int SetPacScript( | 73 virtual int SetPacScript( |
| 67 const scoped_refptr<ProxyResolverScriptData>& pac_script, | 74 const scoped_refptr<ProxyResolverScriptData>& pac_script, |
| 68 const net::CompletionCallback& callback) = 0; | 75 const net::CompletionCallback& callback) = 0; |
| 69 | 76 |
| 70 private: | 77 private: |
| 71 const bool expects_pac_bytes_; | 78 const bool expects_pac_bytes_; |
| 72 | 79 |
| 80 // Local IP address to use if DNS lookup fails (for Chrome OS). |
| 81 std::string default_my_ip_address_; |
| 82 |
| 73 DISALLOW_COPY_AND_ASSIGN(ProxyResolver); | 83 DISALLOW_COPY_AND_ASSIGN(ProxyResolver); |
| 74 }; | 84 }; |
| 75 | 85 |
| 76 } // namespace net | 86 } // namespace net |
| 77 | 87 |
| 78 #endif // NET_PROXY_PROXY_RESOLVER_H_ | 88 #endif // NET_PROXY_PROXY_RESOLVER_H_ |
| OLD | NEW |