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

Unified Diff: content/shell/shell_url_request_context_getter.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: Add test for IsSafeRedirectTarget Created 7 years, 10 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: 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()));

Powered by Google App Engine
This is Rietveld 408576698