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

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: Fixed merge Created 8 years, 4 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 d4b0dff99ee88839c17e384d4872eda9ecb5b492..9fa788971084240662c9e9d7d42590fdab51cfdb 100644
--- a/chrome/browser/profiles/profile_impl_io_data.cc
+++ b/chrome/browser/profiles/profile_impl_io_data.cc
@@ -32,6 +32,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"
@@ -449,6 +450,16 @@ void ProfileImplIOData::LazyInitializeInternal(
media_request_job_factory_.reset(new net::URLRequestJobFactory);
extensions_job_factory_.reset(new net::URLRequestJobFactory);
+ int set_protocol = main_job_factory_->SetProtocolHandler(
+ chrome::kFileScheme, new net::FileProtocolHandler(network_delegate()));
+ DCHECK(set_protocol);
+ set_protocol = media_request_job_factory_->SetProtocolHandler(
+ chrome::kFileScheme, new net::FileProtocolHandler(network_delegate()));
+ DCHECK(set_protocol);
+ set_protocol = extensions_job_factory_->SetProtocolHandler(
+ chrome::kFileScheme, new net::FileProtocolHandler(NULL));
+ DCHECK(set_protocol);
+
net::URLRequestJobFactory* job_factories[3];
job_factories[0] = main_job_factory_.get();
job_factories[1] = media_request_job_factory_.get();

Powered by Google App Engine
This is Rietveld 408576698