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 251bf00ed2f8b66e1f0396b078c5479e33d4e20e..b268d31cfb3db23fe4614239b9ba9eda9865ab23 100644 |
--- a/content/shell/shell_url_request_context_getter.cc |
+++ b/content/shell/shell_url_request_context_getter.cc |
@@ -27,6 +27,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/protocol_intercept_job_factory.h" |
#include "net/url_request/static_http_user_agent_settings.h" |
#include "net/url_request/url_request_context.h" |
@@ -171,6 +173,8 @@ net::URLRequestContext* ShellURLRequestContextGetter::GetURLRequestContext() { |
scoped_ptr<net::URLRequestJobFactoryImpl> job_factory( |
new net::URLRequestJobFactoryImpl()); |
+ // Keep ProtocolHandlers added in sync with |
+ // ShellContentBrowserClient::IsHandledURL(). |
bool set_protocol = job_factory->SetProtocolHandler( |
chrome::kBlobScheme, blob_protocol_handler_.release()); |
DCHECK(set_protocol); |
@@ -184,6 +188,14 @@ net::URLRequestContext* ShellURLRequestContextGetter::GetURLRequestContext() { |
chrome::kChromeDevToolsScheme, |
chrome_devtools_protocol_handler_.release()); |
DCHECK(set_protocol); |
+ set_protocol = job_factory->SetProtocolHandler( |
+ chrome::kDataScheme, |
+ new net::DataProtocolHandler); |
+ DCHECK(set_protocol); |
+ set_protocol = job_factory->SetProtocolHandler( |
+ chrome::kFileScheme, |
+ new net::FileProtocolHandler); |
+ DCHECK(set_protocol); |
storage_->set_job_factory(new net::ProtocolInterceptJobFactory( |
job_factory.PassAs<net::URLRequestJobFactory>(), |
developer_protocol_handler_.Pass())); |