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

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

Issue 10537056: Replaced static URLRequestFtpJob factory with non-static protocol handler for FTP jobs. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixed ftp_auth_cache Created 8 years, 6 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 509435f13cb8b9fee0a8da00ad6c2da12038cd3c..b52a67c3aced5c57d62f9a20922ce37c9f1e7ba1 100644
--- a/chrome/browser/profiles/profile_impl_io_data.cc
+++ b/chrome/browser/profiles/profile_impl_io_data.cc
@@ -30,6 +30,7 @@
#include "net/base/server_bound_cert_service.h"
#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/url_request_job_factory.h"
#include "webkit/quota/special_storage_policy.h"
@@ -446,8 +447,14 @@ 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();
+
for (int i = 0; i < 3; i++) {
SetUpJobFactoryDefaults(job_factories[i]);
+ CreateFtpProtocolHandler(job_factories[i], ftp_auth_caches[i]);
AddConnectInterceptor(job_factories[i]);
}
@@ -539,6 +546,16 @@ ProfileImplIOData::AcquireIsolatedAppRequestContext(
return app_request_context;
}
+void ProfileImplIOData::CreateFtpProtocolHandler(
+ net::URLRequestJobFactory* job_factory,
+ net::FtpAuthCache* ftp_auth_cache) const {
+ job_factory->SetProtocolHandler(
+ chrome::kFtpScheme,
+ new net::FtpProtocolHandler(network_delegate(),
+ ftp_factory_.get(),
+ ftp_auth_cache));
+}
+
void ProfileImplIOData::AddConnectInterceptor(
net::URLRequestJobFactory* job_factory) const {
job_factory->AddInterceptor(

Powered by Google App Engine
This is Rietveld 408576698