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

Unified Diff: chrome/browser/profiles/profile_impl_io_data.cc

Issue 10702137: Replaced static URLRequestHTTPJob factory with non-static protocol handler for HTTP jobs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed nits Created 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/profiles/profile_impl_io_data.cc
diff --git a/chrome/browser/profiles/profile_impl_io_data.cc b/chrome/browser/profiles/profile_impl_io_data.cc
index 8bf761e061e5112cad5617e2647387ca29fb088e..2ade16761695795ef5ac02a71ebcfdc83abcffad 100644
--- a/chrome/browser/profiles/profile_impl_io_data.cc
+++ b/chrome/browser/profiles/profile_impl_io_data.cc
@@ -33,6 +33,7 @@
#include "net/ftp/ftp_network_layer.h"
#include "net/http/http_cache.h"
#include "net/url_request/ftp_protocol_handler.h"
+#include "net/url_request/http_protocol_handler.h"
#include "net/url_request/url_request_job_factory.h"
#include "webkit/quota/special_storage_policy.h"
@@ -454,14 +455,54 @@ void ProfileImplIOData::LazyInitializeInternal(
job_factories[1] = media_request_job_factory_.get();
job_factories[2] = extensions_job_factory_.get();
- net::FtpAuthCache* ftp_auth_caches[3];
- ftp_auth_caches[0] = main_context->ftp_auth_cache();
- ftp_auth_caches[1] = media_request_context_->ftp_auth_cache();
- ftp_auth_caches[2] = extensions_context->ftp_auth_cache();
+ bool set_protocol = main_job_factory_->SetProtocolHandler(
+ chrome::kHttpScheme,
+ new net::HttpProtocolHandler(main_cache,
+ network_delegate(),
+ io_thread_globals->throttler_manager.get(),
+ main_context->accept_language(),
+ main_context->accept_charset(),
+ cookie_store,
+ fraudulent_certificate_reporter(),
+ main_context->ssl_config_service(),
+ transport_security_state()));
+ DCHECK(set_protocol);
+ set_protocol = media_request_job_factory_->SetProtocolHandler(
+ chrome::kHttpScheme,
+ new net::HttpProtocolHandler(media_cache,
+ network_delegate(),
+ io_thread_globals->throttler_manager.get(),
+ main_context->accept_language(),
+ main_context->accept_charset(),
+ cookie_store,
+ fraudulent_certificate_reporter(),
+ main_context->ssl_config_service(),
+ transport_security_state()));
+ DCHECK(set_protocol);
+ set_protocol = extensions_job_factory_->SetProtocolHandler(
+ chrome::kHttpScheme,
+ new net::HttpProtocolHandler(NULL,
+ NULL,
+ io_thread_globals->throttler_manager.get(),
+ main_context->accept_language(),
+ main_context->accept_charset(),
+ extensions_cookie_store,
+ NULL,
+ main_context->ssl_config_service(),
+ transport_security_state()));
+ DCHECK(set_protocol);
+ CreateFtpProtocolHandler(job_factories[0],
+ main_context->ftp_auth_cache(),
+ network_delegate());
+ CreateFtpProtocolHandler(job_factories[1],
+ media_request_context_->ftp_auth_cache(),
+ network_delegate());
+ CreateFtpProtocolHandler(job_factories[2],
+ extensions_context->ftp_auth_cache(),
+ NULL);
for (int i = 0; i < 3; i++) {
SetUpJobFactoryDefaults(job_factories[i]);
- CreateFtpProtocolHandler(job_factories[i], ftp_auth_caches[i]);
job_factories[i]->AddInterceptor(
new chrome_browser_net::ConnectInterceptor(predictor_.get()));
}
@@ -566,12 +607,14 @@ ProfileImplIOData::AcquireIsolatedAppRequestContext(
void ProfileImplIOData::CreateFtpProtocolHandler(
net::URLRequestJobFactory* job_factory,
- net::FtpAuthCache* ftp_auth_cache) const {
- job_factory->SetProtocolHandler(
+ net::FtpAuthCache* ftp_auth_cache,
+ net::NetworkDelegate* network_delegate) const {
+ bool set_protocol = job_factory->SetProtocolHandler(
chrome::kFtpScheme,
- new net::FtpProtocolHandler(network_delegate(),
+ new net::FtpProtocolHandler(network_delegate,
ftp_factory_.get(),
ftp_auth_cache));
+ DCHECK(set_protocol);
}
void ProfileImplIOData::ClearNetworkingHistorySinceOnIOThread(

Powered by Google App Engine
This is Rietveld 408576698