OLD | NEW |
---|---|
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-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 "webkit/tools/test_shell/test_shell_request_context.h" | 5 #include "webkit/tools/test_shell/test_shell_request_context.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 | 8 |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "net/base/cookie_monster.h" | 10 #include "net/base/cookie_monster.h" |
(...skipping 19 matching lines...) Expand all Loading... | |
30 void TestShellRequestContext::Init( | 30 void TestShellRequestContext::Init( |
31 const FilePath& cache_path, | 31 const FilePath& cache_path, |
32 net::HttpCache::Mode cache_mode, | 32 net::HttpCache::Mode cache_mode, |
33 bool no_proxy) { | 33 bool no_proxy) { |
34 cookie_store_ = new net::CookieMonster(); | 34 cookie_store_ = new net::CookieMonster(); |
35 | 35 |
36 // hard-code A-L and A-C for test shells | 36 // hard-code A-L and A-C for test shells |
37 accept_language_ = "en-us,en"; | 37 accept_language_ = "en-us,en"; |
38 accept_charset_ = "iso-8859-1,*,utf-8"; | 38 accept_charset_ = "iso-8859-1,*,utf-8"; |
39 | 39 |
40 #if defined(OS_LINUX) | 40 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
41 // Use no proxy to avoid ProxyConfigServiceLinux. | 41 // Use no proxy to avoid ProxyConfigServiceLinux. |
42 // Enabling use of the ProxyConfigServiceLinux requires: | 42 // Enabling use of the ProxyConfigServiceLinux requires: |
43 // -Calling from a thread with a TYPE_UI MessageLoop, | 43 // -Calling from a thread with a TYPE_UI MessageLoop, |
44 // -If at all possible, passing in a pointer to the IO thread's MessageLoop, | 44 // -If at all possible, passing in a pointer to the IO thread's MessageLoop, |
45 // -Keep in mind that proxy auto configuration is also | 45 // -Keep in mind that proxy auto configuration is also |
46 // non-functional on linux in this context because of v8 threading | 46 // non-functional on linux in this context because of v8 threading |
47 // issues. | 47 // issues. |
48 // TODO(port): rename "linux" to some inspecific unix. | |
agl
2009/12/30 23:12:56
"nonspecific"
| |
48 scoped_ptr<net::ProxyConfigService> proxy_config_service( | 49 scoped_ptr<net::ProxyConfigService> proxy_config_service( |
49 new net::ProxyConfigServiceFixed(net::ProxyConfig())); | 50 new net::ProxyConfigServiceFixed(net::ProxyConfig())); |
50 #else | 51 #else |
51 // Use the system proxy settings. | 52 // Use the system proxy settings. |
52 scoped_ptr<net::ProxyConfigService> proxy_config_service( | 53 scoped_ptr<net::ProxyConfigService> proxy_config_service( |
53 net::ProxyService::CreateSystemProxyConfigService(NULL, NULL)); | 54 net::ProxyService::CreateSystemProxyConfigService(NULL, NULL)); |
54 #endif | 55 #endif |
55 host_resolver_ = net::CreateSystemHostResolver(); | 56 host_resolver_ = net::CreateSystemHostResolver(); |
56 proxy_service_ = net::ProxyService::Create(proxy_config_service.release(), | 57 proxy_service_ = net::ProxyService::Create(proxy_config_service.release(), |
57 false, NULL, NULL); | 58 false, NULL, NULL); |
(...skipping 15 matching lines...) Expand all Loading... | |
73 | 74 |
74 TestShellRequestContext::~TestShellRequestContext() { | 75 TestShellRequestContext::~TestShellRequestContext() { |
75 delete ftp_transaction_factory_; | 76 delete ftp_transaction_factory_; |
76 delete http_transaction_factory_; | 77 delete http_transaction_factory_; |
77 } | 78 } |
78 | 79 |
79 const std::string& TestShellRequestContext::GetUserAgent( | 80 const std::string& TestShellRequestContext::GetUserAgent( |
80 const GURL& url) const { | 81 const GURL& url) const { |
81 return webkit_glue::GetUserAgent(url); | 82 return webkit_glue::GetUserAgent(url); |
82 } | 83 } |
OLD | NEW |