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 | |
81 private: | 77 private: |
82 // Called to set the PAC script backend to use. If |pac_url| is invalid, | 78 // Called to set the PAC script backend to use. If |pac_url| is invalid, |
83 // this is a request to use WPAD (auto detect). |pac_script| may be empty if | 79 // this is a request to use WPAD (auto detect). |pac_script| may be empty if |
84 // the fetch failed, or if the fetch returned no content. | 80 // the fetch failed, or if the fetch returned no content. |
85 // Returns ERR_IO_PENDING in the case of asynchronous completion, and notifies | 81 // Returns ERR_IO_PENDING in the case of asynchronous completion, and notifies |
86 // the result through |callback|. | 82 // the result through |callback|. |
87 virtual int SetPacScript(const GURL& pac_url, | 83 virtual int SetPacScript(const GURL& pac_url, |
88 const string16& pac_script, | 84 const string16& pac_script, |
89 CompletionCallback* callback) = 0; | 85 CompletionCallback* callback) = 0; |
90 | 86 |
91 const bool expects_pac_bytes_; | 87 const bool expects_pac_bytes_; |
92 | 88 |
93 DISALLOW_COPY_AND_ASSIGN(ProxyResolver); | 89 DISALLOW_COPY_AND_ASSIGN(ProxyResolver); |
94 }; | 90 }; |
95 | 91 |
96 } // namespace net | 92 } // namespace net |
97 | 93 |
98 #endif // NET_PROXY_PROXY_RESOLVER_H_ | 94 #endif // NET_PROXY_PROXY_RESOLVER_H_ |
OLD | NEW |