| 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_V8_H_ | 5 #ifndef NET_PROXY_PROXY_RESOLVER_V8_H_ |
| 6 #define NET_PROXY_PROXY_RESOLVER_V8_H_ | 6 #define NET_PROXY_PROXY_RESOLVER_V8_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 virtual int GetProxyForURL(const GURL& query_url, | 49 virtual int GetProxyForURL(const GURL& query_url, |
| 50 const GURL& /*pac_url*/, | 50 const GURL& /*pac_url*/, |
| 51 ProxyInfo* results); | 51 ProxyInfo* results); |
| 52 virtual void SetPacScript(const std::string& bytes); | 52 virtual void SetPacScript(const std::string& bytes); |
| 53 | 53 |
| 54 JSBindings* js_bindings() const { return js_bindings_.get(); } | 54 JSBindings* js_bindings() const { return js_bindings_.get(); } |
| 55 | 55 |
| 56 // Creates a default javascript bindings implementation that will: | 56 // Creates a default javascript bindings implementation that will: |
| 57 // - Send script error messages to LOG(INFO) | 57 // - Send script error messages to LOG(INFO) |
| 58 // - Send script alert()s to LOG(INFO) | 58 // - Send script alert()s to LOG(INFO) |
| 59 // - Use the provided host mapper to service dnsResolve(). | 59 // - Use the provided host resolver to service dnsResolve(). |
| 60 // | 60 // |
| 61 // For clients that need more control (for example, sending the script output | 61 // For clients that need more control (for example, sending the script output |
| 62 // to a UI widget), use the ProxyResolverV8(JSBindings*) and specify your | 62 // to a UI widget), use the ProxyResolverV8(JSBindings*) and specify your |
| 63 // own bindings. | 63 // own bindings. |
| 64 // | 64 // |
| 65 // |host_resolver| will be used in async mode on |host_resolver_loop|. If | 65 // |host_resolver| will be used in async mode on |host_resolver_loop|. If |
| 66 // |host_resolver_loop| is NULL, then |host_resolver| will be used in sync | 66 // |host_resolver_loop| is NULL, then |host_resolver| will be used in sync |
| 67 // mode on the PAC thread. | 67 // mode on the PAC thread. |
| 68 static JSBindings* CreateDefaultBindings(HostResolver* host_resolver, | 68 static JSBindings* CreateDefaultBindings(HostResolver* host_resolver, |
| 69 MessageLoop* host_resolver_loop); | 69 MessageLoop* host_resolver_loop); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 95 virtual std::string DnsResolve(const std::string& host) = 0; | 95 virtual std::string DnsResolve(const std::string& host) = 0; |
| 96 | 96 |
| 97 // Handler for when an error is encountered. |line_number| may be -1 | 97 // Handler for when an error is encountered. |line_number| may be -1 |
| 98 // if a line number is not applicable to this error. | 98 // if a line number is not applicable to this error. |
| 99 virtual void OnError(int line_number, const std::string& error) = 0; | 99 virtual void OnError(int line_number, const std::string& error) = 0; |
| 100 }; | 100 }; |
| 101 | 101 |
| 102 } // namespace net | 102 } // namespace net |
| 103 | 103 |
| 104 #endif // NET_PROXY_PROXY_RESOLVER_V8_H_ | 104 #endif // NET_PROXY_PROXY_RESOLVER_V8_H_ |
| OLD | NEW |