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

Side by Side Diff: content/shell/shell_url_request_context_getter.cc

Issue 10831277: [net] Change factory methods for HostResolver and HostCache to return a scoped_ptr (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 8 years, 2 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/shell/shell_url_request_context_getter.h" 5 #include "content/shell/shell_url_request_context_getter.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/string_split.h" 9 #include "base/string_split.h"
10 #include "base/threading/worker_pool.h" 10 #include "base/threading/worker_pool.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 url_request_context_->set_network_delegate(network_delegate_.get()); 59 url_request_context_->set_network_delegate(network_delegate_.get());
60 storage_.reset( 60 storage_.reset(
61 new net::URLRequestContextStorage(url_request_context_.get())); 61 new net::URLRequestContextStorage(url_request_context_.get()));
62 storage_->set_cookie_store(new net::CookieMonster(NULL, NULL)); 62 storage_->set_cookie_store(new net::CookieMonster(NULL, NULL));
63 storage_->set_server_bound_cert_service(new net::ServerBoundCertService( 63 storage_->set_server_bound_cert_service(new net::ServerBoundCertService(
64 new net::DefaultServerBoundCertStore(NULL), 64 new net::DefaultServerBoundCertStore(NULL),
65 base::WorkerPool::GetTaskRunner(true))); 65 base::WorkerPool::GetTaskRunner(true)));
66 url_request_context_->set_accept_language("en-us,en"); 66 url_request_context_->set_accept_language("en-us,en");
67 url_request_context_->set_accept_charset("iso-8859-1,*,utf-8"); 67 url_request_context_->set_accept_charset("iso-8859-1,*,utf-8");
68 68
69 storage_->set_host_resolver( 69 storage_->set_host_resolver(net::HostResolver::CreateDefaultResolver(NULL));
70 net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism,
71 net::HostResolver::kDefaultRetryAttempts,
72 NULL));
73 storage_->set_cert_verifier(net::CertVerifier::CreateDefault()); 70 storage_->set_cert_verifier(net::CertVerifier::CreateDefault());
74 // TODO(jam): use v8 if possible, look at chrome code. 71 // TODO(jam): use v8 if possible, look at chrome code.
75 storage_->set_proxy_service( 72 storage_->set_proxy_service(
76 net::ProxyService::CreateUsingSystemProxyResolver( 73 net::ProxyService::CreateUsingSystemProxyResolver(
77 proxy_config_service_.release(), 74 proxy_config_service_.release(),
78 0, 75 0,
79 NULL)); 76 NULL));
80 storage_->set_ssl_config_service(new net::SSLConfigServiceDefaults); 77 storage_->set_ssl_config_service(new net::SSLConfigServiceDefaults);
81 storage_->set_http_auth_handler_factory( 78 storage_->set_http_auth_handler_factory(
82 net::HttpAuthHandlerFactory::CreateDefault( 79 net::HttpAuthHandlerFactory::CreateDefault(
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 scoped_refptr<base::SingleThreadTaskRunner> 122 scoped_refptr<base::SingleThreadTaskRunner>
126 ShellURLRequestContextGetter::GetNetworkTaskRunner() const { 123 ShellURLRequestContextGetter::GetNetworkTaskRunner() const {
127 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); 124 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO);
128 } 125 }
129 126
130 net::HostResolver* ShellURLRequestContextGetter::host_resolver() { 127 net::HostResolver* ShellURLRequestContextGetter::host_resolver() {
131 return url_request_context_->host_resolver(); 128 return url_request_context_->host_resolver();
132 } 129 }
133 130
134 } // namespace content 131 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698