Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(483)

Side by Side Diff: net/proxy/proxy_resolver_mac.cc

Issue 149525: Remove the concept of threading from ProxyService, and move it into the Proxy... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Add missing header for mac Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/proxy/proxy_resolver_mac.h ('k') | net/proxy/proxy_resolver_perftest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include <CoreServices/CoreServices.h> 8 #include <CoreServices/CoreServices.h>
9 #include <SystemConfiguration/SystemConfiguration.h> 9 #include <SystemConfiguration/SystemConfiguration.h>
10 10
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 GetBoolFromDictionary(config_dict.get(), 236 GetBoolFromDictionary(config_dict.get(),
237 kSCPropNetProxiesExcludeSimpleHostnames, 237 kSCPropNetProxiesExcludeSimpleHostnames,
238 false); 238 false);
239 239
240 return OK; 240 return OK;
241 } 241 }
242 242
243 // Gets the proxy information for a query URL from a PAC. Implementation 243 // Gets the proxy information for a query URL from a PAC. Implementation
244 // inspired by http://developer.apple.com/samplecode/CFProxySupportTool/ 244 // inspired by http://developer.apple.com/samplecode/CFProxySupportTool/
245 int ProxyResolverMac::GetProxyForURL(const GURL& query_url, 245 int ProxyResolverMac::GetProxyForURL(const GURL& query_url,
246 const GURL& pac_url, 246 ProxyInfo* results,
247 ProxyInfo* results) { 247 CompletionCallback* /*callback*/,
248 RequestHandle* /*request*/) {
248 scoped_cftyperef<CFStringRef> query_ref( 249 scoped_cftyperef<CFStringRef> query_ref(
249 base::SysUTF8ToCFStringRef(query_url.spec())); 250 base::SysUTF8ToCFStringRef(query_url.spec()));
250 scoped_cftyperef<CFURLRef> query_url_ref( 251 scoped_cftyperef<CFURLRef> query_url_ref(
251 CFURLCreateWithString(kCFAllocatorDefault, 252 CFURLCreateWithString(kCFAllocatorDefault,
252 query_ref.get(), 253 query_ref.get(),
253 NULL)); 254 NULL));
254 if (!query_url_ref.get()) 255 if (!query_url_ref.get())
255 return ERR_FAILED; 256 return ERR_FAILED;
256 scoped_cftyperef<CFStringRef> pac_ref( 257 scoped_cftyperef<CFStringRef> pac_ref(
257 base::SysUTF8ToCFStringRef(pac_url.spec())); 258 base::SysUTF8ToCFStringRef(pac_url_.spec()));
258 scoped_cftyperef<CFURLRef> pac_url_ref( 259 scoped_cftyperef<CFURLRef> pac_url_ref(
259 CFURLCreateWithString(kCFAllocatorDefault, 260 CFURLCreateWithString(kCFAllocatorDefault,
260 pac_ref.get(), 261 pac_ref.get(),
261 NULL)); 262 NULL));
262 if (!pac_url_ref.get()) 263 if (!pac_url_ref.get())
263 return ERR_FAILED; 264 return ERR_FAILED;
264 265
265 // Work around <rdar://problem/5530166>. This dummy call to 266 // Work around <rdar://problem/5530166>. This dummy call to
266 // CFNetworkCopyProxiesForURL initializes some state within CFNetwork that is 267 // CFNetworkCopyProxiesForURL initializes some state within CFNetwork that is
267 // required by CFNetworkExecuteProxyAutoConfigurationURL. 268 // required by CFNetworkExecuteProxyAutoConfigurationURL.
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 } 349 }
349 350
350 if (!proxy_uri_list.empty()) 351 if (!proxy_uri_list.empty())
351 results->UseNamedProxy(proxy_uri_list); 352 results->UseNamedProxy(proxy_uri_list);
352 // Else do nothing (results is already guaranteed to be in the default state). 353 // Else do nothing (results is already guaranteed to be in the default state).
353 354
354 return OK; 355 return OK;
355 } 356 }
356 357
357 } // namespace net 358 } // namespace net
OLDNEW
« no previous file with comments | « net/proxy/proxy_resolver_mac.h ('k') | net/proxy/proxy_resolver_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698