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

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

Issue 5961005: Create a URLRequestContext for PAC fetching. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments. Created 10 years 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_service.h" 5 #include "net/proxy/proxy_service.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 461
462 // static 462 // static
463 ProxyService* ProxyService::CreateFixed(const std::string& proxy) { 463 ProxyService* ProxyService::CreateFixed(const std::string& proxy) {
464 net::ProxyConfig proxy_config; 464 net::ProxyConfig proxy_config;
465 proxy_config.proxy_rules().ParseFromString(proxy); 465 proxy_config.proxy_rules().ParseFromString(proxy);
466 return ProxyService::CreateFixed(proxy_config); 466 return ProxyService::CreateFixed(proxy_config);
467 } 467 }
468 468
469 // static 469 // static
470 ProxyService* ProxyService::CreateDirect() { 470 ProxyService* ProxyService::CreateDirect() {
471 return CreateDirectWithNetLog(NULL);
472 }
473
474 ProxyService* ProxyService::CreateDirectWithNetLog(NetLog* net_log) {
471 // Use direct connections. 475 // Use direct connections.
472 return new ProxyService(new ProxyConfigServiceDirect, new ProxyResolverNull, 476 return new ProxyService(new ProxyConfigServiceDirect, new ProxyResolverNull,
473 NULL); 477 net_log);
474 } 478 }
475 479
476 // static 480 // static
477 ProxyService* ProxyService::CreateFixedFromPacResult( 481 ProxyService* ProxyService::CreateFixedFromPacResult(
478 const std::string& pac_string) { 482 const std::string& pac_string) {
479 483
480 // We need the settings to contain an "automatic" setting, otherwise the 484 // We need the settings to contain an "automatic" setting, otherwise the
481 // ProxyResolver dependency we give it will never be used. 485 // ProxyResolver dependency we give it will never be used.
482 scoped_ptr<ProxyConfigService> proxy_config_service( 486 scoped_ptr<ProxyConfigService> proxy_config_service(
483 new ProxyConfigServiceFixed(ProxyConfig::CreateAutoDetect())); 487 new ProxyConfigServiceFixed(ProxyConfig::CreateAutoDetect()));
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
939 OnCompletion(result_); 943 OnCompletion(result_);
940 } 944 }
941 } 945 }
942 946
943 void SyncProxyServiceHelper::OnCompletion(int rv) { 947 void SyncProxyServiceHelper::OnCompletion(int rv) {
944 result_ = rv; 948 result_ = rv;
945 event_.Signal(); 949 event_.Signal();
946 } 950 }
947 951
948 } // namespace net 952 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698