Index: content/shell/shell_url_request_context_getter.cc |
diff --git a/content/shell/shell_url_request_context_getter.cc b/content/shell/shell_url_request_context_getter.cc |
index 3c4cb1290fc86261bbc3b110c8646ba438a29609..38ee5482f1526e226ec382bd0bea16cb08459042 100644 |
--- a/content/shell/shell_url_request_context_getter.cc |
+++ b/content/shell/shell_url_request_context_getter.cc |
@@ -12,6 +12,7 @@ |
#include "base/threading/worker_pool.h" |
#include "content/public/browser/browser_thread.h" |
#include "content/public/common/content_switches.h" |
+#include "content/public/common/url_constants.h" |
#include "content/shell/shell_network_delegate.h" |
#include "net/base/cert_verifier.h" |
#include "net/base/default_server_bound_cert_store.h" |
@@ -25,6 +26,8 @@ |
#include "net/http/http_network_session.h" |
#include "net/http/http_server_properties_impl.h" |
#include "net/proxy/proxy_service.h" |
+#include "net/url_request/data_protocol_handler.h" |
+#include "net/url_request/file_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" |
@@ -144,7 +147,15 @@ net::URLRequestContext* ShellURLRequestContextGetter::GetURLRequestContext() { |
network_session_params, main_backend); |
storage_->set_http_transaction_factory(main_cache); |
- storage_->set_job_factory(new net::URLRequestJobFactoryImpl); |
+ net::URLRequestJobFactoryImpl* job_factory = |
+ new net::URLRequestJobFactoryImpl; |
+ // Keep ProtocolHandlers added in sync with |
+ // ShellContentBrowserClient::IsHandledURL(). |
+ job_factory->SetProtocolHandler(chrome::kDataScheme, |
+ new net::DataProtocolHandler); |
+ job_factory->SetProtocolHandler(chrome::kFileScheme, |
+ new net::FileProtocolHandler); |
+ storage_->set_job_factory(job_factory); |
} |
return url_request_context_.get(); |