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

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: add ChromeBrowserFieldTrials::AsyncDnsFieldTrial Created 8 years, 4 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/logging.h" 7 #include "base/logging.h"
8 #include "base/string_split.h" 8 #include "base/string_split.h"
9 #include "base/threading/worker_pool.h" 9 #include "base/threading/worker_pool.h"
10 #include "content/public/browser/browser_thread.h" 10 #include "content/public/browser/browser_thread.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 storage_.reset( 56 storage_.reset(
57 new net::URLRequestContextStorage(url_request_context_.get())); 57 new net::URLRequestContextStorage(url_request_context_.get()));
58 storage_->set_cookie_store(new net::CookieMonster(NULL, NULL)); 58 storage_->set_cookie_store(new net::CookieMonster(NULL, NULL));
59 storage_->set_server_bound_cert_service(new net::ServerBoundCertService( 59 storage_->set_server_bound_cert_service(new net::ServerBoundCertService(
60 new net::DefaultServerBoundCertStore(NULL), 60 new net::DefaultServerBoundCertStore(NULL),
61 base::WorkerPool::GetTaskRunner(true))); 61 base::WorkerPool::GetTaskRunner(true)));
62 url_request_context_->set_accept_language("en-us,en"); 62 url_request_context_->set_accept_language("en-us,en");
63 url_request_context_->set_accept_charset("iso-8859-1,*,utf-8"); 63 url_request_context_->set_accept_charset("iso-8859-1,*,utf-8");
64 64
65 storage_->set_host_resolver( 65 storage_->set_host_resolver(
66 net::CreateSystemHostResolver(net::HostResolver::kDefaultParallelism, 66 net::HostResolver::CreateDefaultResolver(NULL).release());
67 net::HostResolver::kDefaultRetryAttempts,
68 NULL));
69 storage_->set_cert_verifier(net::CertVerifier::CreateDefault()); 67 storage_->set_cert_verifier(net::CertVerifier::CreateDefault());
70 // TODO(jam): use v8 if possible, look at chrome code. 68 // TODO(jam): use v8 if possible, look at chrome code.
71 storage_->set_proxy_service( 69 storage_->set_proxy_service(
72 net::ProxyService::CreateUsingSystemProxyResolver( 70 net::ProxyService::CreateUsingSystemProxyResolver(
73 proxy_config_service_.release(), 71 proxy_config_service_.release(),
74 0, 72 0,
75 NULL)); 73 NULL));
76 storage_->set_ssl_config_service(new net::SSLConfigServiceDefaults); 74 storage_->set_ssl_config_service(new net::SSLConfigServiceDefaults);
77 storage_->set_http_auth_handler_factory( 75 storage_->set_http_auth_handler_factory(
78 net::HttpAuthHandlerFactory::CreateDefault( 76 net::HttpAuthHandlerFactory::CreateDefault(
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 scoped_refptr<base::SingleThreadTaskRunner> 111 scoped_refptr<base::SingleThreadTaskRunner>
114 ShellURLRequestContextGetter::GetNetworkTaskRunner() const { 112 ShellURLRequestContextGetter::GetNetworkTaskRunner() const {
115 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO); 113 return BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO);
116 } 114 }
117 115
118 net::HostResolver* ShellURLRequestContextGetter::host_resolver() { 116 net::HostResolver* ShellURLRequestContextGetter::host_resolver() {
119 return url_request_context_->host_resolver(); 117 return url_request_context_->host_resolver();
120 } 118 }
121 119
122 } // namespace content 120 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698