Chromium Code Reviews| Index: chrome/browser/io_thread.cc |
| diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc |
| index bc6de39faf1450af4ffb8523872a123d93bd1771..494aa0e7573f4c2e63d8370a21b0563a7877470c 100644 |
| --- a/chrome/browser/io_thread.cc |
| +++ b/chrome/browser/io_thread.cc |
| @@ -52,6 +52,7 @@ |
| #include "net/proxy/proxy_config_service.h" |
| #include "net/proxy/proxy_script_fetcher_impl.h" |
| #include "net/proxy/proxy_service.h" |
| +#include "net/url_request/url_request_throttler_manager.h" |
| #if defined(USE_NSS) |
| #include "net/ocsp/nss_ocsp.h" |
| @@ -218,6 +219,7 @@ ConstructProxyScriptFetcherContext(IOThread::Globals* globals, |
| context->set_server_bound_cert_service( |
| globals->system_server_bound_cert_service.get()); |
| context->set_network_delegate(globals->system_network_delegate.get()); |
| + context->set_throttler_manager(globals->throttler_manager.get()); |
|
willchan no longer on Chromium
2012/05/02 16:40:07
Just doublechecking you want this one. This is for
Jói
2012/05/02 16:45:28
On further reflection I don't think we need it the
|
| // TODO(rtenneti): We should probably use HttpServerPropertiesManager for the |
| // system URLRequestContext too. There's no reason this should be tied to a |
| // profile. |
| @@ -244,6 +246,7 @@ ConstructSystemRequestContext(IOThread::Globals* globals, |
| context->set_cookie_store(globals->system_cookie_store.get()); |
| context->set_server_bound_cert_service( |
| globals->system_server_bound_cert_service.get()); |
| + context->set_throttler_manager(globals->throttler_manager.get()); |
| return context; |
| } |
| @@ -443,6 +446,15 @@ void IOThread::Init() { |
| globals_->proxy_script_fetcher_ftp_transaction_factory.reset( |
| new net::FtpNetworkLayer(globals_->host_resolver.get())); |
| + globals_->throttler_manager.reset(new net::URLRequestThrottlerManager()); |
| + // Always done in production, disabled only for unit tests. |
| + globals_->throttler_manager->set_enable_thread_checks(true); |
| + if (CommandLine::ForCurrentProcess()->HasSwitch( |
| + switches::kDisableExtensionsHttpThrottling)) { |
| + globals_->throttler_manager->set_enforce_throttling(false); |
| + } |
| + globals_->throttler_manager->set_net_log(net_log_); |
| + |
| globals_->proxy_script_fetcher_context = |
| ConstructProxyScriptFetcherContext(globals_, net_log_); |