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

Unified Diff: net/url_request/url_request_context_builder.cc

Issue 11931024: Removed static factories for data, ftp, file, and about jobs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync (r198785) Created 7 years, 7 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
« no previous file with comments | « net/url_request/url_request_context_builder.h ('k') | net/url_request/url_request_context_storage.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_context_builder.cc
diff --git a/net/url_request/url_request_context_builder.cc b/net/url_request/url_request_context_builder.cc
index f391ebff922b927e35b29423587e8c81224122dd..893ada66c0fa8599811cd87502d7169e1b2a76b3 100644
--- a/net/url_request/url_request_context_builder.cc
+++ b/net/url_request/url_request_context_builder.cc
@@ -26,9 +26,13 @@
#include "net/http/transport_security_state.h"
#include "net/proxy/proxy_service.h"
#include "net/ssl/ssl_config_service_defaults.h"
+#include "net/url_request/data_protocol_handler.h"
+#include "net/url_request/file_protocol_handler.h"
+#include "net/url_request/ftp_protocol_handler.h"
#include "net/url_request/static_http_user_agent_settings.h"
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_storage.h"
+#include "net/url_request/url_request_job_factory_impl.h"
namespace net {
@@ -180,7 +184,11 @@ URLRequestContextBuilder::HttpNetworkSessionParams::~HttpNetworkSessionParams()
{}
URLRequestContextBuilder::URLRequestContextBuilder()
- : ftp_enabled_(false),
+ : data_enabled_(false),
+ file_enabled_(false),
+#if !defined(DISABLE_FTP_SUPPORT)
+ ftp_enabled_(false),
+#endif
http_cache_enabled_(true) {}
URLRequestContextBuilder::~URLRequestContextBuilder() {}
@@ -205,11 +213,6 @@ URLRequestContext* URLRequestContextBuilder::Build() {
storage->set_host_resolver(net::HostResolver::CreateDefaultResolver(NULL));
- if (ftp_enabled_) {
- storage->set_ftp_transaction_factory(
- new FtpNetworkLayer(context->host_resolver()));
- }
-
context->StartFileThread();
// TODO(willchan): Switch to using this code when
@@ -290,6 +293,21 @@ URLRequestContext* URLRequestContextBuilder::Build() {
}
storage->set_http_transaction_factory(http_transaction_factory);
+ URLRequestJobFactoryImpl* job_factory = new URLRequestJobFactoryImpl;
+ if (data_enabled_)
+ job_factory->SetProtocolHandler("data", new DataProtocolHandler);
+ if (file_enabled_)
+ job_factory->SetProtocolHandler("file", new FileProtocolHandler);
+#if !defined(DISABLE_FTP_SUPPORT)
+ if (ftp_enabled_) {
+ ftp_transaction_factory_.reset(
+ new FtpNetworkLayer(context->host_resolver()));
+ job_factory->SetProtocolHandler("ftp",
+ new FtpProtocolHandler(ftp_transaction_factory_.get()));
+ }
+#endif
+ storage->set_job_factory(job_factory);
+
// TODO(willchan): Support sdch.
return context;
« no previous file with comments | « net/url_request/url_request_context_builder.h ('k') | net/url_request/url_request_context_storage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698