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

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

Issue 10700117: Replaced static URLRequestFileJob factory with non-static protocol handler for File jobs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed context from file_dir_job, merged with error_job cl 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 da2887875a1312af88ad47a7f156927238444cdc..a9928f949315e7e0dae80ac3cd75cf9589ba96f6 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/file_protocol_handler.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"
@@ -454,6 +455,7 @@ void ProfileImplIOData::LazyInitializeInternal(
for (int i = 0; i < 3; i++) {
SetUpJobFactoryDefaults(job_factories[i]);
+ CreateFileProtocolHandler(job_factories[i]);
CreateFtpProtocolHandler(job_factories[i], ftp_auth_caches[i]);
job_factories[i]->AddInterceptor(
new chrome_browser_net::ConnectInterceptor(predictor_.get()));
@@ -547,6 +549,13 @@ ProfileImplIOData::AcquireIsolatedAppRequestContext(
return app_request_context;
}
+void ProfileImplIOData::CreateFileProtocolHandler(
+ net::URLRequestJobFactory* job_factory) const {
+ job_factory->SetProtocolHandler(
+ chrome::kFtpScheme,
erikwright (departed) 2012/07/13 14:50:36 kFileScheme?
shalev 2012/07/17 19:40:16 Done.
+ new net::FileProtocolHandler(network_delegate()));
+}
+
void ProfileImplIOData::CreateFtpProtocolHandler(
net::URLRequestJobFactory* job_factory,
net::FtpAuthCache* ftp_auth_cache) const {

Powered by Google App Engine
This is Rietveld 408576698