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

Unified Diff: net/url_request/url_request_context_builder.cc

Issue 253603004: Make it so net/ can be built without file:// support. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: merge Created 6 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_unittest.cc » ('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
===================================================================
--- net/url_request/url_request_context_builder.cc (revision 268640)
+++ net/url_request/url_request_context_builder.cc (working copy)
@@ -28,13 +28,19 @@
#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"
+#if !defined(DISABLE_FILE_SUPPORT)
+#include "net/url_request/file_protocol_handler.h"
+#endif
+
+#if !defined(DISABLE_FTP_SUPPORT)
+#include "net/url_request/ftp_protocol_handler.h"
+#endif
+
namespace net {
namespace {
@@ -187,7 +193,9 @@
URLRequestContextBuilder::URLRequestContextBuilder()
: data_enabled_(false),
+#if !defined(DISABLE_FILE_SUPPORT)
file_enabled_(false),
+#endif
#if !defined(DISABLE_FTP_SUPPORT)
ftp_enabled_(false),
#endif
@@ -313,11 +321,15 @@
URLRequestJobFactoryImpl* job_factory = new URLRequestJobFactoryImpl;
if (data_enabled_)
job_factory->SetProtocolHandler("data", new DataProtocolHandler);
+
+#if !defined(DISABLE_FILE_SUPPORT)
if (file_enabled_) {
job_factory->SetProtocolHandler(
"file",
new FileProtocolHandler(context->GetFileThread()->message_loop_proxy()));
}
+#endif // !defined(DISABLE_FILE_SUPPORT)
+
#if !defined(DISABLE_FTP_SUPPORT)
if (ftp_enabled_) {
ftp_transaction_factory_.reset(
@@ -325,7 +337,8 @@
job_factory->SetProtocolHandler("ftp",
new FtpProtocolHandler(ftp_transaction_factory_.get()));
}
-#endif
+#endif // !defined(DISABLE_FTP_SUPPORT)
+
storage->set_job_factory(job_factory);
// TODO(willchan): Support sdch.
« no previous file with comments | « net/url_request/url_request_context_builder.h ('k') | net/url_request/url_request_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698