service worker: Remove URLRequest interceptor.
No longer needed following the launch of S13nServiceWorker.
Bug: 926114
Change-Id: Icf911a0d6f498bf72327a2392e0e6f286fdcf029
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1510616
Commit-Queue: Matt Falkenhagen <falken@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#638934}
diff --git a/content/browser/service_worker/service_worker_request_handler.cc b/content/browser/service_worker/service_worker_request_handler.cc
index 9bebae98..05ebba7 100644
--- a/content/browser/service_worker/service_worker_request_handler.cc
+++ b/content/browser/service_worker/service_worker_request_handler.cc
@@ -26,7 +26,6 @@
#include "ipc/ipc_message.h"
#include "net/base/url_util.h"
#include "net/url_request/url_request.h"
-#include "net/url_request/url_request_interceptor.h"
#include "services/network/public/cpp/resource_request_body.h"
#include "storage/browser/blob/blob_storage_context.h"
#include "third_party/blink/public/common/service_worker/service_worker_utils.h"
@@ -35,28 +34,6 @@
namespace {
-class ServiceWorkerRequestInterceptor
- : public net::URLRequestInterceptor {
- public:
- explicit ServiceWorkerRequestInterceptor(ResourceContext* resource_context)
- : resource_context_(resource_context) {}
- ~ServiceWorkerRequestInterceptor() override {}
- net::URLRequestJob* MaybeInterceptRequest(
- net::URLRequest* request,
- net::NetworkDelegate* network_delegate) const override {
- ServiceWorkerRequestHandler* handler =
- ServiceWorkerRequestHandler::GetHandler(request);
- if (!handler)
- return nullptr;
- return handler->MaybeCreateJob(
- request, network_delegate, resource_context_);
- }
-
- private:
- ResourceContext* resource_context_;
- DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRequestInterceptor);
-};
-
bool SchemeMaySupportRedirectingToHTTPS(const GURL& url) {
#if defined(OS_CHROMEOS)
return url.SchemeIs(kExternalFileScheme);
@@ -216,14 +193,6 @@
}
// static
-std::unique_ptr<net::URLRequestInterceptor>
-ServiceWorkerRequestHandler::CreateInterceptor(
- ResourceContext* resource_context) {
- return std::unique_ptr<net::URLRequestInterceptor>(
- new ServiceWorkerRequestInterceptor(resource_context));
-}
-
-// static
bool ServiceWorkerRequestHandler::IsControlledByServiceWorker(
const net::URLRequest* request) {
ServiceWorkerRequestHandler* handler = GetHandler(request);
diff --git a/content/browser/service_worker/service_worker_request_handler.h b/content/browser/service_worker/service_worker_request_handler.h
index 3993f64..9e723d5 100644
--- a/content/browser/service_worker/service_worker_request_handler.h
+++ b/content/browser/service_worker/service_worker_request_handler.h
@@ -25,7 +25,6 @@
namespace net {
class NetworkDelegate;
class URLRequest;
-class URLRequestInterceptor;
}
namespace network {
@@ -102,10 +101,6 @@
static ServiceWorkerRequestHandler* GetHandler(
const net::URLRequest* request);
- // Creates a protocol interceptor for ServiceWorker.
- static std::unique_ptr<net::URLRequestInterceptor> CreateInterceptor(
- ResourceContext* resource_context);
-
// Returns true if the request falls into the scope of a ServiceWorker.
// It's only reliable after the ServiceWorkerRequestHandler MaybeCreateJob
// method runs to completion for this request. The AppCache handler uses
diff --git a/content/browser/storage_partition_impl_map.cc b/content/browser/storage_partition_impl_map.cc
index ac79b6f..4d42ad98 100644
--- a/content/browser/storage_partition_impl_map.cc
+++ b/content/browser/storage_partition_impl_map.cc
@@ -34,7 +34,6 @@
#include "content/browser/loader/prefetch_url_loader_service.h"
#include "content/browser/loader/resource_request_info_impl.h"
#include "content/browser/resource_context_impl.h"
-#include "content/browser/service_worker/service_worker_request_handler.h"
#include "content/browser/storage_partition_impl.h"
#include "content/browser/streams/stream.h"
#include "content/browser/streams/stream_context.h"
@@ -419,8 +418,6 @@
DevToolsURLRequestInterceptor::MaybeCreate(browser_context_);
if (devtools_interceptor)
request_interceptors.push_back(std::move(devtools_interceptor));
- request_interceptors.push_back(ServiceWorkerRequestHandler::CreateInterceptor(
- browser_context_->GetResourceContext()));
request_interceptors.push_back(std::make_unique<AppCacheInterceptor>());
bool create_request_context = true;