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 #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 #include <CoreServices/CoreServices.h> | 8 #include <CoreServices/CoreServices.h> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 ProxyResolverMac::ProxyResolverMac() | 62 ProxyResolverMac::ProxyResolverMac() |
63 : ProxyResolver(false /*expects_pac_bytes*/) { | 63 : ProxyResolver(false /*expects_pac_bytes*/) { |
64 } | 64 } |
65 | 65 |
66 ProxyResolverMac::~ProxyResolverMac() {} | 66 ProxyResolverMac::~ProxyResolverMac() {} |
67 | 67 |
68 // Gets the proxy information for a query URL from a PAC. Implementation | 68 // Gets the proxy information for a query URL from a PAC. Implementation |
69 // inspired by http://developer.apple.com/samplecode/CFProxySupportTool/ | 69 // inspired by http://developer.apple.com/samplecode/CFProxySupportTool/ |
70 int ProxyResolverMac::GetProxyForURL(const GURL& query_url, | 70 int ProxyResolverMac::GetProxyForURL(const GURL& query_url, |
71 ProxyInfo* results, | 71 ProxyInfo* results, |
72 OldCompletionCallback* /*callback*/, | 72 const CompletionCallback& /*callback*/, |
73 RequestHandle* /*request*/, | 73 RequestHandle* /*request*/, |
74 const BoundNetLog& net_log) { | 74 const BoundNetLog& net_log) { |
75 base::mac::ScopedCFTypeRef<CFStringRef> query_ref( | 75 base::mac::ScopedCFTypeRef<CFStringRef> query_ref( |
76 base::SysUTF8ToCFStringRef(query_url.spec())); | 76 base::SysUTF8ToCFStringRef(query_url.spec())); |
77 base::mac::ScopedCFTypeRef<CFURLRef> query_url_ref( | 77 base::mac::ScopedCFTypeRef<CFURLRef> query_url_ref( |
78 CFURLCreateWithString(kCFAllocatorDefault, | 78 CFURLCreateWithString(kCFAllocatorDefault, |
79 query_ref.get(), | 79 query_ref.get(), |
80 NULL)); | 80 NULL)); |
81 if (!query_url_ref.get()) | 81 if (!query_url_ref.get()) |
82 return ERR_FAILED; | 82 return ERR_FAILED; |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 RequestHandle request) const { | 195 RequestHandle request) const { |
196 return LOAD_STATE_IDLE; | 196 return LOAD_STATE_IDLE; |
197 } | 197 } |
198 | 198 |
199 void ProxyResolverMac::CancelSetPacScript() { | 199 void ProxyResolverMac::CancelSetPacScript() { |
200 NOTREACHED(); | 200 NOTREACHED(); |
201 } | 201 } |
202 | 202 |
203 int ProxyResolverMac::SetPacScript( | 203 int ProxyResolverMac::SetPacScript( |
204 const scoped_refptr<ProxyResolverScriptData>& script_data, | 204 const scoped_refptr<ProxyResolverScriptData>& script_data, |
205 OldCompletionCallback* /*callback*/) { | 205 const CompletionCallback& /*callback*/) { |
206 script_data_ = script_data; | 206 script_data_ = script_data; |
207 return OK; | 207 return OK; |
208 } | 208 } |
209 | 209 |
210 } // namespace net | 210 } // namespace net |
OLD | NEW |