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

Side by Side Diff: chrome/browser/io_thread.cc

Issue 6012008: Don't leak proxy script fetcher's http transaction factories. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 12 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 | « chrome/browser/io_thread.h ('k') | chrome/browser/net/connection_tester_unittest.cc » ('j') | 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/browser/io_thread.h" 5 #include "chrome/browser/io_thread.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/leak_tracker.h" 10 #include "base/debug/leak_tracker.h"
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 net::NetLog* net_log) { 182 net::NetLog* net_log) {
183 scoped_refptr<URLRequestContext> context(new URLRequestContext); 183 scoped_refptr<URLRequestContext> context(new URLRequestContext);
184 context->set_net_log(net_log); 184 context->set_net_log(net_log);
185 context->set_host_resolver(globals->host_resolver.get()); 185 context->set_host_resolver(globals->host_resolver.get());
186 context->set_cert_verifier(globals->cert_verifier.get()); 186 context->set_cert_verifier(globals->cert_verifier.get());
187 context->set_dnsrr_resolver(globals->dnsrr_resolver.get()); 187 context->set_dnsrr_resolver(globals->dnsrr_resolver.get());
188 context->set_http_auth_handler_factory( 188 context->set_http_auth_handler_factory(
189 globals->http_auth_handler_factory.get()); 189 globals->http_auth_handler_factory.get());
190 context->set_proxy_service(globals->proxy_script_fetcher_proxy_service.get()); 190 context->set_proxy_service(globals->proxy_script_fetcher_proxy_service.get());
191 context->set_http_transaction_factory( 191 context->set_http_transaction_factory(
192 new net::HttpNetworkLayer( 192 globals->proxy_script_fetcher_http_transaction_factory.get());
193 globals->client_socket_factory,
194 globals->host_resolver.get(),
195 globals->cert_verifier.get(),
196 globals->dnsrr_resolver.get(),
197 NULL /* dns_cert_checker */,
198 NULL /* ssl_host_info_factory */,
199 globals->proxy_script_fetcher_proxy_service.get(),
200 globals->ssl_config_service.get(),
201 new net::SpdySessionPool(globals->ssl_config_service.get()),
202 globals->http_auth_handler_factory.get(),
203 &globals->network_delegate,
204 net_log));
205 // In-memory cookie store. 193 // In-memory cookie store.
206 context->set_cookie_store(new net::CookieMonster(NULL, NULL)); 194 context->set_cookie_store(new net::CookieMonster(NULL, NULL));
207 return context; 195 return context;
208 } 196 }
209 197
210 } // namespace 198 } // namespace
211 199
212 // The IOThread object must outlive any tasks posted to the IO thread before the 200 // The IOThread object must outlive any tasks posted to the IO thread before the
213 // Quit task. 201 // Quit task.
214 DISABLE_RUNNABLE_METHOD_REFCOUNT(IOThread); 202 DISABLE_RUNNABLE_METHOD_REFCOUNT(IOThread);
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 globals_->cert_verifier.reset(new net::CertVerifier); 326 globals_->cert_verifier.reset(new net::CertVerifier);
339 globals_->dnsrr_resolver.reset(new net::DnsRRResolver); 327 globals_->dnsrr_resolver.reset(new net::DnsRRResolver);
340 // TODO(willchan): Use the real SSLConfigService. 328 // TODO(willchan): Use the real SSLConfigService.
341 globals_->ssl_config_service = 329 globals_->ssl_config_service =
342 net::SSLConfigService::CreateSystemSSLConfigService(); 330 net::SSLConfigService::CreateSystemSSLConfigService();
343 globals_->http_auth_handler_factory.reset(CreateDefaultAuthHandlerFactory( 331 globals_->http_auth_handler_factory.reset(CreateDefaultAuthHandlerFactory(
344 globals_->host_resolver.get())); 332 globals_->host_resolver.get()));
345 // For the ProxyScriptFetcher, we use a direct ProxyService. 333 // For the ProxyScriptFetcher, we use a direct ProxyService.
346 globals_->proxy_script_fetcher_proxy_service = 334 globals_->proxy_script_fetcher_proxy_service =
347 net::ProxyService::CreateDirectWithNetLog(net_log_); 335 net::ProxyService::CreateDirectWithNetLog(net_log_);
336 globals_->proxy_script_fetcher_http_transaction_factory.reset(
337 new net::HttpNetworkLayer(
338 globals_->client_socket_factory,
339 globals_->host_resolver.get(),
340 globals_->cert_verifier.get(),
341 globals_->dnsrr_resolver.get(),
342 NULL /* dns_cert_checker */,
343 NULL /* ssl_host_info_factory */,
344 globals_->proxy_script_fetcher_proxy_service.get(),
345 globals_->ssl_config_service.get(),
346 new net::SpdySessionPool(globals_->ssl_config_service.get()),
347 globals_->http_auth_handler_factory.get(),
348 &globals_->network_delegate,
349 net_log_));
348 350
349 scoped_refptr<URLRequestContext> proxy_script_fetcher_context = 351 scoped_refptr<URLRequestContext> proxy_script_fetcher_context =
350 ConstructProxyScriptFetcherContext(globals_, net_log_); 352 ConstructProxyScriptFetcherContext(globals_, net_log_);
351 globals_->proxy_script_fetcher_context = proxy_script_fetcher_context; 353 globals_->proxy_script_fetcher_context = proxy_script_fetcher_context;
352 354
353 if (CommandLine::ForCurrentProcess()->HasSwitch( 355 if (CommandLine::ForCurrentProcess()->HasSwitch(
354 switches::kEnablePagePrerender)) { 356 switches::kEnablePagePrerender)) {
355 prerender_interceptor_.reset(new PrerenderInterceptor()); 357 prerender_interceptor_.reset(new PrerenderInterceptor());
356 } 358 }
357 } 359 }
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 net::HostCache* host_cache = 514 net::HostCache* host_cache =
513 globals_->host_resolver.get()->GetAsHostResolverImpl()->cache(); 515 globals_->host_resolver.get()->GetAsHostResolverImpl()->cache();
514 if (host_cache) 516 if (host_cache)
515 host_cache->clear(); 517 host_cache->clear();
516 } 518 }
517 // Clear all of the passively logged data. 519 // Clear all of the passively logged data.
518 // TODO(eroman): this is a bit heavy handed, really all we need to do is 520 // TODO(eroman): this is a bit heavy handed, really all we need to do is
519 // clear the data pertaining to off the record context. 521 // clear the data pertaining to off the record context.
520 net_log_->ClearAllPassivelyCapturedEvents(); 522 net_log_->ClearAllPassivelyCapturedEvents();
521 } 523 }
OLDNEW
« no previous file with comments | « chrome/browser/io_thread.h ('k') | chrome/browser/net/connection_tester_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698