| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 } // namespace | 52 } // namespace |
| 53 | 53 |
| 54 namespace net { | 54 namespace net { |
| 55 | 55 |
| 56 // Gets the proxy information for a query URL from a PAC. Implementation | 56 // Gets the proxy information for a query URL from a PAC. Implementation |
| 57 // inspired by http://developer.apple.com/samplecode/CFProxySupportTool/ | 57 // inspired by http://developer.apple.com/samplecode/CFProxySupportTool/ |
| 58 int ProxyResolverMac::GetProxyForURL(const GURL& query_url, | 58 int ProxyResolverMac::GetProxyForURL(const GURL& query_url, |
| 59 ProxyInfo* results, | 59 ProxyInfo* results, |
| 60 CompletionCallback* /*callback*/, | 60 CompletionCallback* /*callback*/, |
| 61 RequestHandle* /*request*/, | 61 RequestHandle* /*request*/, |
| 62 LoadLog* load_log) { | 62 const BoundNetLog& net_log) { |
| 63 scoped_cftyperef<CFStringRef> query_ref( | 63 scoped_cftyperef<CFStringRef> query_ref( |
| 64 base::SysUTF8ToCFStringRef(query_url.spec())); | 64 base::SysUTF8ToCFStringRef(query_url.spec())); |
| 65 scoped_cftyperef<CFURLRef> query_url_ref( | 65 scoped_cftyperef<CFURLRef> query_url_ref( |
| 66 CFURLCreateWithString(kCFAllocatorDefault, | 66 CFURLCreateWithString(kCFAllocatorDefault, |
| 67 query_ref.get(), | 67 query_ref.get(), |
| 68 NULL)); | 68 NULL)); |
| 69 if (!query_url_ref.get()) | 69 if (!query_url_ref.get()) |
| 70 return ERR_FAILED; | 70 return ERR_FAILED; |
| 71 scoped_cftyperef<CFStringRef> pac_ref( | 71 scoped_cftyperef<CFStringRef> pac_ref( |
| 72 base::SysUTF8ToCFStringRef(pac_url_.spec())); | 72 base::SysUTF8ToCFStringRef(pac_url_.spec())); |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 } | 163 } |
| 164 | 164 |
| 165 if (!proxy_uri_list.empty()) | 165 if (!proxy_uri_list.empty()) |
| 166 results->UseNamedProxy(proxy_uri_list); | 166 results->UseNamedProxy(proxy_uri_list); |
| 167 // Else do nothing (results is already guaranteed to be in the default state). | 167 // Else do nothing (results is already guaranteed to be in the default state). |
| 168 | 168 |
| 169 return OK; | 169 return OK; |
| 170 } | 170 } |
| 171 | 171 |
| 172 } // namespace net | 172 } // namespace net |
| OLD | NEW |