OLD | NEW |
1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2008 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 #include "net/proxy/proxy_resolver_mac.h" | 5 #include "net/proxy/proxy_resolver_mac.h" |
6 | 6 |
7 #include <CoreFoundation/CoreFoundation.h> | 7 #include <CoreFoundation/CoreFoundation.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/mac_util.h" | 10 #include "base/mac_util.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 } else { | 46 } else { |
47 *result_ptr = CFRetain(proxies); | 47 *result_ptr = CFRetain(proxies); |
48 } | 48 } |
49 CFRunLoopStop(CFRunLoopGetCurrent()); | 49 CFRunLoopStop(CFRunLoopGetCurrent()); |
50 } | 50 } |
51 | 51 |
52 } // namespace | 52 } // namespace |
53 | 53 |
54 namespace net { | 54 namespace net { |
55 | 55 |
| 56 ProxyResolverMac::ProxyResolverMac() |
| 57 : ProxyResolver(false /*expects_pac_bytes*/) { |
| 58 } |
| 59 |
| 60 ProxyResolverMac::~ProxyResolverMac() {} |
| 61 |
56 // Gets the proxy information for a query URL from a PAC. Implementation | 62 // Gets the proxy information for a query URL from a PAC. Implementation |
57 // inspired by http://developer.apple.com/samplecode/CFProxySupportTool/ | 63 // inspired by http://developer.apple.com/samplecode/CFProxySupportTool/ |
58 int ProxyResolverMac::GetProxyForURL(const GURL& query_url, | 64 int ProxyResolverMac::GetProxyForURL(const GURL& query_url, |
59 ProxyInfo* results, | 65 ProxyInfo* results, |
60 CompletionCallback* /*callback*/, | 66 CompletionCallback* /*callback*/, |
61 RequestHandle* /*request*/, | 67 RequestHandle* /*request*/, |
62 const BoundNetLog& net_log) { | 68 const BoundNetLog& net_log) { |
63 base::mac::ScopedCFTypeRef<CFStringRef> query_ref( | 69 base::mac::ScopedCFTypeRef<CFStringRef> query_ref( |
64 base::SysUTF8ToCFStringRef(query_url.spec())); | 70 base::SysUTF8ToCFStringRef(query_url.spec())); |
65 base::mac::ScopedCFTypeRef<CFURLRef> query_url_ref( | 71 base::mac::ScopedCFTypeRef<CFURLRef> query_url_ref( |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 proxy_uri_list += proxy_server.ToURI(); | 170 proxy_uri_list += proxy_server.ToURI(); |
165 } | 171 } |
166 | 172 |
167 if (!proxy_uri_list.empty()) | 173 if (!proxy_uri_list.empty()) |
168 results->UseNamedProxy(proxy_uri_list); | 174 results->UseNamedProxy(proxy_uri_list); |
169 // Else do nothing (results is already guaranteed to be in the default state). | 175 // Else do nothing (results is already guaranteed to be in the default state). |
170 | 176 |
171 return OK; | 177 return OK; |
172 } | 178 } |
173 | 179 |
| 180 void ProxyResolverMac::CancelRequest(RequestHandle request) { |
| 181 NOTREACHED(); |
| 182 } |
| 183 |
| 184 void ProxyResolverMac::CancelSetPacScript() { |
| 185 NOTREACHED(); |
| 186 } |
| 187 |
| 188 int ProxyResolverMac::SetPacScript( |
| 189 const scoped_refptr<ProxyResolverScriptData>& script_data, |
| 190 CompletionCallback* /*callback*/) { |
| 191 script_data_ = script_data; |
| 192 return OK; |
| 193 } |
| 194 |
174 } // namespace net | 195 } // namespace net |
OLD | NEW |