Commit cae599a0 authored by Matt Menke's avatar Matt Menke Committed by Commit Bot

Remove FileProtocolHandler on iOS.

Internal requests should not end up in file URLs, and Safari handles
other requests, so we shouldn't need it. FileProtocoloHandler is no
longer in use on other platforms, so we should be able to delete it.

Bug: 934009
Change-Id: I00749a080b8bcda2a3ff4655a40ce9835e42e608
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1783911Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Commit-Queue: Matt Menke <mmenke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#693787}
parent e453c631
...@@ -67,10 +67,6 @@ class ChromeBrowserStateIOData { ...@@ -67,10 +67,6 @@ class ChromeBrowserStateIOData {
virtual ~ChromeBrowserStateIOData(); virtual ~ChromeBrowserStateIOData();
// Returns true if |scheme| is handled in Chrome, or by default handlers in
// net::URLRequest.
static bool IsHandledProtocol(const std::string& scheme);
// Utility to install additional WebUI handlers into the |job_factory|. // Utility to install additional WebUI handlers into the |job_factory|.
// Ownership of the handlers is transferred from |protocol_handlers| // Ownership of the handlers is transferred from |protocol_handlers|
// to the |job_factory|. // to the |job_factory|.
......
...@@ -58,7 +58,6 @@ ...@@ -58,7 +58,6 @@
#include "net/proxy_resolution/proxy_resolution_service.h" #include "net/proxy_resolution/proxy_resolution_service.h"
#include "net/traffic_annotation/network_traffic_annotation.h" #include "net/traffic_annotation/network_traffic_annotation.h"
#include "net/url_request/data_protocol_handler.h" #include "net/url_request/data_protocol_handler.h"
#include "net/url_request/file_protocol_handler.h"
#include "net/url_request/report_sender.h" #include "net/url_request/report_sender.h"
#include "net/url_request/url_request.h" #include "net/url_request/url_request.h"
#include "net/url_request/url_request_context.h" #include "net/url_request/url_request_context.h"
...@@ -218,19 +217,6 @@ ChromeBrowserStateIOData::~ChromeBrowserStateIOData() { ...@@ -218,19 +217,6 @@ ChromeBrowserStateIOData::~ChromeBrowserStateIOData() {
} }
} }
// static
bool ChromeBrowserStateIOData::IsHandledProtocol(const std::string& scheme) {
DCHECK_EQ(scheme, base::ToLowerASCII(scheme));
static const char* const kProtocolList[] = {
url::kFileScheme, kChromeUIScheme, url::kDataScheme, url::kAboutScheme,
};
for (size_t i = 0; i < base::size(kProtocolList); ++i) {
if (scheme == kProtocolList[i])
return true;
}
return net::URLRequest::IsHandledProtocol(scheme);
}
// static // static
void ChromeBrowserStateIOData::InstallProtocolHandlers( void ChromeBrowserStateIOData::InstallProtocolHandlers(
net::URLRequestJobFactoryImpl* job_factory, net::URLRequestJobFactoryImpl* job_factory,
...@@ -415,17 +401,7 @@ std::unique_ptr<net::URLRequestJobFactory> ...@@ -415,17 +401,7 @@ std::unique_ptr<net::URLRequestJobFactory>
ChromeBrowserStateIOData::SetUpJobFactoryDefaults( ChromeBrowserStateIOData::SetUpJobFactoryDefaults(
std::unique_ptr<net::URLRequestJobFactoryImpl> job_factory, std::unique_ptr<net::URLRequestJobFactoryImpl> job_factory,
net::NetworkDelegate* network_delegate) const { net::NetworkDelegate* network_delegate) const {
// NOTE(willchan): Keep these protocol handlers in sync with
// ChromeBrowserStateIOData::IsHandledProtocol().
bool set_protocol = job_factory->SetProtocolHandler( bool 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_protocol = job_factory->SetProtocolHandler(
url::kDataScheme, std::make_unique<net::DataProtocolHandler>()); url::kDataScheme, std::make_unique<net::DataProtocolHandler>());
DCHECK(set_protocol); DCHECK(set_protocol);
......
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