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

Unified Diff: chrome/browser/profiles/off_the_record_profile_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/off_the_record_profile_io_data.cc
diff --git a/chrome/browser/profiles/off_the_record_profile_io_data.cc b/chrome/browser/profiles/off_the_record_profile_io_data.cc
index 830d6df17e42294fb8ae4fb32561180725cc1835..04bbddb052c90f878e7976462bb9fe5112393b06 100644
--- a/chrome/browser/profiles/off_the_record_profile_io_data.cc
+++ b/chrome/browser/profiles/off_the_record_profile_io_data.cc
@@ -27,6 +27,7 @@
#include "net/ftp/ftp_network_layer.h"
#include "net/http/http_cache.h"
#include "net/http/http_server_properties_impl.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/database/database_tracker.h"
@@ -261,6 +262,7 @@ void OffTheRecordProfileIOData::LazyInitializeInternal(
for (int i = 0; i < 2; i++) {
SetUpJobFactoryDefaults(job_factories[i]);
+ CreateFileProtocolHandler(job_factories[i]);
CreateFtpProtocolHandler(job_factories[i], ftp_auth_caches[i]);
}
@@ -311,6 +313,13 @@ OffTheRecordProfileIOData::AcquireIsolatedAppRequestContext(
return app_request_context;
}
+void OffTheRecordProfileIOData::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 OffTheRecordProfileIOData::CreateFtpProtocolHandler(
net::URLRequestJobFactory* job_factory,
net::FtpAuthCache* ftp_auth_cache) const {
@@ -319,4 +328,3 @@ void OffTheRecordProfileIOData::CreateFtpProtocolHandler(
new net::FtpProtocolHandler(
network_delegate(), ftp_factory_.get(), ftp_auth_cache));
}
-

Powered by Google App Engine
This is Rietveld 408576698