Commit 419383a1 authored by Matt Menke's avatar Matt Menke Committed by Commit Bot

Remove file and data URL support from Chromecast's URLRequestContext.

The URLRequestContext is only being used by one internal legacy
consumer, which doesn't need either file or data URL support. We'll want
to remove the URLRequestContext when we can, but for now, removing these
two factories will let us remove the code in net/ to handle those two
types of URLs, as they're not handled by the network service.

Bug: 934009
Change-Id: I753f03bcc6e9f915cb64490d9bee9a8664a90695
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1787401Reviewed-by: default avatarJunbo Ke <juke@chromium.org>
Reviewed-by: default avatarLuke Halliwell <halliwell@chromium.org>
Commit-Queue: Matt Menke <mmenke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#693847}
parent 43574cce
......@@ -39,8 +39,6 @@
#include "net/http/http_stream_factory.h"
#include "net/proxy_resolution/proxy_resolution_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/url_request_context.h"
#include "net/url_request/url_request_context_builder.h"
#include "net/url_request/url_request_context_getter.h"
......@@ -247,28 +245,13 @@ void URLRequestContextFactory::InitializeMainContextDependencies(
new net::URLRequestJobFactoryImpl());
// Keep ProtocolHandlers added in sync with
// CastContentBrowserClient::IsHandledURL().
bool set_protocol = false;
for (content::ProtocolHandlerMap::iterator it = protocol_handlers->begin();
it != protocol_handlers->end();
++it) {
set_protocol =
bool set_protocol =
job_factory->SetProtocolHandler(it->first, std::move(it->second));
DCHECK(set_protocol);
}
set_protocol = job_factory->SetProtocolHandler(
url::kDataScheme, std::make_unique<net::DataProtocolHandler>());
DCHECK(set_protocol);
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableLocalFileAccesses)) {
set_protocol = job_factory->SetProtocolHandler(
url::kFileScheme,
std::make_unique<net::FileProtocolHandler>(base::CreateTaskRunner(
{base::ThreadPool(), base::MayBlock(),
base::TaskPriority::BEST_EFFORT,
base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN})));
DCHECK(set_protocol);
}
// Set up interceptors in the reverse order.
std::unique_ptr<net::URLRequestJobFactory> top_job_factory =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment