| 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 #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/string16.h" | 9 #include "base/string16.h" |
| 10 #include "googleurl/src/gurl.h" | 10 #include "googleurl/src/gurl.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 // TODO(eroman): Make this =0. | 67 // TODO(eroman): Make this =0. |
| 68 virtual void CancelSetPacScript() { | 68 virtual void CancelSetPacScript() { |
| 69 NOTREACHED(); | 69 NOTREACHED(); |
| 70 } | 70 } |
| 71 | 71 |
| 72 // Frees any unneeded memory held by the resolver, e.g. garbage in the JS | 72 // Frees any unneeded memory held by the resolver, e.g. garbage in the JS |
| 73 // engine. Most subclasses don't need to do anything, so we provide a default | 73 // engine. Most subclasses don't need to do anything, so we provide a default |
| 74 // no-op implementation. | 74 // no-op implementation. |
| 75 virtual void PurgeMemory() {} | 75 virtual void PurgeMemory() {} |
| 76 | 76 |
| 77 // Optional shutdown code to be run before destruction. This is only used |
| 78 // by the multithreaded runner to signal cleanup from origin thread |
| 79 virtual void Shutdown() {} |
| 80 |
| 77 private: | 81 private: |
| 78 // Called to set the PAC script backend to use. If |pac_url| is invalid, | 82 // Called to set the PAC script backend to use. If |pac_url| is invalid, |
| 79 // this is a request to use WPAD (auto detect). |pac_script| may be empty if | 83 // this is a request to use WPAD (auto detect). |pac_script| may be empty if |
| 80 // the fetch failed, or if the fetch returned no content. | 84 // the fetch failed, or if the fetch returned no content. |
| 81 // Returns ERR_IO_PENDING in the case of asynchronous completion, and notifies | 85 // Returns ERR_IO_PENDING in the case of asynchronous completion, and notifies |
| 82 // the result through |callback|. | 86 // the result through |callback|. |
| 83 virtual int SetPacScript(const GURL& pac_url, | 87 virtual int SetPacScript(const GURL& pac_url, |
| 84 const string16& pac_script, | 88 const string16& pac_script, |
| 85 CompletionCallback* callback) = 0; | 89 CompletionCallback* callback) = 0; |
| 86 | 90 |
| 87 const bool expects_pac_bytes_; | 91 const bool expects_pac_bytes_; |
| 88 | 92 |
| 89 DISALLOW_COPY_AND_ASSIGN(ProxyResolver); | 93 DISALLOW_COPY_AND_ASSIGN(ProxyResolver); |
| 90 }; | 94 }; |
| 91 | 95 |
| 92 } // namespace net | 96 } // namespace net |
| 93 | 97 |
| 94 #endif // NET_PROXY_PROXY_RESOLVER_H_ | 98 #endif // NET_PROXY_PROXY_RESOLVER_H_ |
| OLD | NEW |