Commit 25557557 authored by Matt Falkenhagen's avatar Matt Falkenhagen Committed by Commit Bot

loading: Remove unused BlobRegistry from fetch contexts.

Also remove unused Send() method.

Change-Id: I68118f84c4851c85310ec04287126c47042c3e69
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2394600Reviewed-by: default avatarHiroki Nakagawa <nhiroki@chromium.org>
Commit-Queue: Matt Falkenhagen <falken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#804648}
parent 03a26c48
......@@ -12,7 +12,6 @@
#include "base/task/thread_pool.h"
#include "base/threading/sequenced_task_runner_handle.h"
#include "content/child/child_thread_impl.h"
#include "content/child/thread_safe_sender.h"
#include "content/common/content_constants_internal.h"
#include "content/common/frame_messages.h"
#include "content/public/common/content_client.h"
......@@ -211,8 +210,6 @@ scoped_refptr<WebWorkerFetchContextImpl> WebWorkerFetchContextImpl::Create(
GetContentClient()
->renderer()
->CreateWebSocketHandshakeThrottleProvider(),
ChildThreadImpl::current()->thread_safe_sender(),
ChildThreadImpl::current()->child_process_host(),
cors_exempt_header_list,
std::move(pending_resource_load_info_notifier)));
if (provider_context) {
......@@ -245,8 +242,6 @@ WebWorkerFetchContextImpl::WebWorkerFetchContextImpl(
std::unique_ptr<URLLoaderThrottleProvider> throttle_provider,
std::unique_ptr<WebSocketHandshakeThrottleProvider>
websocket_handshake_throttle_provider,
ThreadSafeSender* thread_safe_sender,
mojo::SharedRemote<mojom::ChildProcessHost> process_host,
const std::vector<std::string>& cors_exempt_header_list,
mojo::PendingRemote<blink::mojom::ResourceLoadInfoNotifier>
pending_resource_load_info_notifier)
......@@ -260,14 +255,12 @@ WebWorkerFetchContextImpl::WebWorkerFetchContextImpl(
pending_fallback_factory_(std::move(pending_fallback_factory)),
pending_subresource_loader_updater_(
std::move(pending_subresource_loader_updater)),
thread_safe_sender_(thread_safe_sender),
renderer_preferences_(std::move(renderer_preferences)),
preference_watcher_pending_receiver_(
std::move(preference_watcher_receiver)),
throttle_provider_(std::move(throttle_provider)),
websocket_handshake_throttle_provider_(
std::move(websocket_handshake_throttle_provider)),
process_host_(std::move(process_host)),
cors_exempt_header_list_(cors_exempt_header_list),
pending_resource_load_info_notifier_(
std::move(pending_resource_load_info_notifier)) {}
......@@ -413,13 +406,6 @@ void WebWorkerFetchContextImpl::InitializeOnWorkerThread(
std::move(pending_service_worker_container_host_));
}
mojo::Remote<blink::mojom::BlobRegistry> blob_registry_remote;
process_host_->BindHostReceiver(
blob_registry_remote.BindNewPipeAndPassReceiver());
blob_registry_ = base::MakeRefCounted<
base::RefCountedData<mojo::Remote<blink::mojom::BlobRegistry>>>(
std::move(blob_registry_remote));
if (pending_resource_load_info_notifier_) {
resource_load_info_notifier_.Bind(
std::move(pending_resource_load_info_notifier_));
......@@ -613,7 +599,7 @@ WebWorkerFetchContextImpl::CloneForNestedWorkerInternal(
? websocket_handshake_throttle_provider_->Clone(
std::move(task_runner))
: nullptr,
thread_safe_sender_.get(), process_host_, cors_exempt_header_list_,
cors_exempt_header_list_,
std::move(pending_resource_load_info_notifier)));
new_context->is_on_sub_frame_ = is_on_sub_frame_;
new_context->ancestor_frame_id_ = ancestor_frame_id_;
......@@ -624,10 +610,6 @@ WebWorkerFetchContextImpl::CloneForNestedWorkerInternal(
return new_context;
}
bool WebWorkerFetchContextImpl::Send(IPC::Message* message) {
return thread_safe_sender_->Send(message);
}
void WebWorkerFetchContextImpl::ResetServiceWorkerURLLoaderFactory() {
if (!web_loader_factory_)
return;
......
......@@ -10,18 +10,14 @@
#include "base/strings/string_piece.h"
#include "base/synchronization/waitable_event.h"
#include "content/common/child_process.mojom.h"
#include "content/common/content_export.h"
#include "ipc/ipc_message.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "mojo/public/cpp/bindings/remote_set.h"
#include "mojo/public/cpp/bindings/shared_remote.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
#include "services/network/public/mojom/url_loader_factory.mojom-forward.h"
#include "third_party/blink/public/mojom/blob/blob_registry.mojom-forward.h"
#include "third_party/blink/public/mojom/loader/resource_load_info_notifier.mojom.h"
#include "third_party/blink/public/mojom/renderer_preference_watcher.mojom.h"
#include "third_party/blink/public/mojom/renderer_preferences.mojom.h"
......@@ -38,15 +34,10 @@ namespace blink {
class WebFrameRequestBlocker;
} // namespace blink
namespace IPC {
class Message;
} // namespace IPC
namespace content {
class ResourceDispatcher;
class ServiceWorkerProviderContext;
class ThreadSafeSender;
class URLLoaderThrottleProvider;
class WebSocketHandshakeThrottleProvider;
......@@ -218,8 +209,6 @@ class CONTENT_EXPORT WebWorkerFetchContextImpl
std::unique_ptr<URLLoaderThrottleProvider> throttle_provider,
std::unique_ptr<WebSocketHandshakeThrottleProvider>
websocket_handshake_throttle_provider,
ThreadSafeSender* thread_safe_sender,
mojo::SharedRemote<mojom::ChildProcessHost> process_host,
const std::vector<std::string>& cors_exempt_header_list,
mojo::PendingRemote<blink::mojom::ResourceLoadInfoNotifier>
pending_resource_load_info_notifier);
......@@ -241,8 +230,6 @@ class CONTENT_EXPORT WebWorkerFetchContextImpl
pending_subresource_loader_updater,
scoped_refptr<base::SingleThreadTaskRunner> task_runner);
bool Send(IPC::Message* message);
// Resets the service worker url loader factory of a URLLoaderFactoryImpl
// which was passed to Blink. The url loader factory is connected to the
// controller service worker. Sets nullptr if the worker context is not
......@@ -321,11 +308,6 @@ class CONTENT_EXPORT WebWorkerFetchContextImpl
mojo::Receiver<blink::mojom::SubresourceLoaderUpdater>
subresource_loader_updater_{this};
// Initialized on the worker thread when InitializeOnWorkerThread() is called.
scoped_refptr<base::RefCountedData<mojo::Remote<blink::mojom::BlobRegistry>>>
blob_registry_;
scoped_refptr<ThreadSafeSender> thread_safe_sender_;
std::unique_ptr<blink::WebDocumentSubresourceFilter::Builder>
subresource_filter_builder_;
// For dedicated workers, this is the ancestor frame (the parent frame for
......@@ -364,8 +346,6 @@ class CONTENT_EXPORT WebWorkerFetchContextImpl
std::unique_ptr<WebSocketHandshakeThrottleProvider>
websocket_handshake_throttle_provider_;
mojo::SharedRemote<mojom::ChildProcessHost> process_host_;
std::vector<std::string> cors_exempt_header_list_;
mojo::PendingRemote<blink::mojom::ResourceLoadInfoNotifier>
......
......@@ -46,7 +46,6 @@
#include "third_party/blink/public/common/service_worker/service_worker_status_code.h"
#include "third_party/blink/public/common/service_worker/service_worker_utils.h"
#include "third_party/blink/public/mojom/blob/blob.mojom.h"
#include "third_party/blink/public/mojom/blob/blob_registry.mojom.h"
#include "third_party/blink/public/mojom/browser_interface_broker.mojom.h"
#include "third_party/blink/public/mojom/loader/request_context_frame_type.mojom.h"
#include "third_party/blink/public/mojom/service_worker/service_worker.mojom.h"
......@@ -321,8 +320,6 @@ void ServiceWorkerContextClient::WillDestroyWorkerContext(
// (while we're still on the worker thread).
proxy_ = nullptr;
blob_registry_.reset();
// We have to clear callbacks now, as they need to be freed on the
// same thread.
context_.reset();
......
......@@ -26,7 +26,6 @@
#include "mojo/public/cpp/bindings/shared_associated_remote.h"
#include "third_party/blink/public/common/service_worker/service_worker_status_code.h"
#include "third_party/blink/public/mojom/background_fetch/background_fetch.mojom-forward.h"
#include "third_party/blink/public/mojom/blob/blob_registry.mojom.h"
#include "third_party/blink/public/mojom/payments/payment_app.mojom-forward.h"
#include "third_party/blink/public/mojom/service_worker/controller_service_worker.mojom-forward.h"
#include "third_party/blink/public/mojom/service_worker/embedded_worker.mojom.h"
......@@ -257,8 +256,6 @@ class CONTENT_EXPORT ServiceWorkerContextClient
// Must be accessed on the initiator thread only.
EmbeddedWorkerInstanceClientImpl* owner_;
mojo::Remote<blink::mojom::BlobRegistry> blob_registry_;
// Initialized on the worker thread in WorkerContextStarted and
// destructed on the worker thread in WillDestroyWorkerContext.
//
......
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