| 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 "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "net/base/cookie_monster.h" | 8 #include "net/base/cookie_monster.h" |
| 9 #include "net/base/host_resolver.h" | 9 #include "net/base/host_resolver.h" |
| 10 #include "net/ftp/ftp_network_layer.h" | 10 #include "net/ftp/ftp_network_layer.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 // Force no_proxy to true so as to use a fixed proxy configuration | 38 // Force no_proxy to true so as to use a fixed proxy configuration |
| 39 // and bypass ProxyConfigServiceLinux. Enabling use of the | 39 // and bypass ProxyConfigServiceLinux. Enabling use of the |
| 40 // ProxyConfigServiceLinux requires: | 40 // ProxyConfigServiceLinux requires: |
| 41 // -Calling from a thread with a TYPE_UI MessageLoop, | 41 // -Calling from a thread with a TYPE_UI MessageLoop, |
| 42 // -If at all possible, passing in a pointer to the IO thread's MessageLoop, | 42 // -If at all possible, passing in a pointer to the IO thread's MessageLoop, |
| 43 // -Keep in mind that proxy auto configuration is also | 43 // -Keep in mind that proxy auto configuration is also |
| 44 // non-functional on linux in this context because of v8 threading | 44 // non-functional on linux in this context because of v8 threading |
| 45 // issues. | 45 // issues. |
| 46 no_proxy = true; | 46 no_proxy = true; |
| 47 #endif | 47 #endif |
| 48 host_resolver_ = new net::HostResolver(); | 48 host_resolver_ = net::CreateSystemHostResolver(); |
| 49 proxy_service_ = net::ProxyService::Create(no_proxy ? &proxy_config : NULL, | 49 proxy_service_ = net::ProxyService::Create(no_proxy ? &proxy_config : NULL, |
| 50 false, NULL, NULL); | 50 false, NULL, NULL); |
| 51 | 51 |
| 52 net::HttpCache *cache; | 52 net::HttpCache *cache; |
| 53 if (cache_path.empty()) { | 53 if (cache_path.empty()) { |
| 54 cache = new net::HttpCache(host_resolver_, proxy_service_, 0); | 54 cache = new net::HttpCache(host_resolver_, proxy_service_, 0); |
| 55 } else { | 55 } else { |
| 56 cache = new net::HttpCache(host_resolver_, proxy_service_, cache_path, 0); | 56 cache = new net::HttpCache(host_resolver_, proxy_service_, cache_path, 0); |
| 57 } | 57 } |
| 58 cache->set_mode(cache_mode); | 58 cache->set_mode(cache_mode); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 72 delete cookie_store_; | 72 delete cookie_store_; |
| 73 delete ftp_transaction_factory_; | 73 delete ftp_transaction_factory_; |
| 74 delete http_transaction_factory_; | 74 delete http_transaction_factory_; |
| 75 delete proxy_service_; | 75 delete proxy_service_; |
| 76 } | 76 } |
| 77 | 77 |
| 78 const std::string& TestShellRequestContext::GetUserAgent( | 78 const std::string& TestShellRequestContext::GetUserAgent( |
| 79 const GURL& url) const { | 79 const GURL& url) const { |
| 80 return webkit_glue::GetUserAgent(url); | 80 return webkit_glue::GetUserAgent(url); |
| 81 } | 81 } |
| OLD | NEW |