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

Side by Side Diff: webkit/tools/test_shell/test_shell_request_context.cc

Issue 149511: Refactorings surrounding HostResolver:... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Merge in socks5_client_socket_unittest.cc Created 11 years, 5 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/url_request/url_request_unittest.cc ('k') | no next file » | 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) 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
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
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 }
OLDNEW
« no previous file with comments | « net/url_request/url_request_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698