Commit dfd295e5 authored by Alexander Timin's avatar Alexander Timin Committed by Commit Bot

Remove mojom::DedicatedWorkerHost interface

Now DedicatedWorkerHost interface doesn't have any methods and this
patch removes it.

This patch can be easily reverted if the need for DedicatedWorkerHost
interface appears again.

TBR=haraken@chromium.org
R=nasko@chromium.org
BUG=1018601

Change-Id: Ia572e086aab3445cd96f5bac5b0cb89186b06ad9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2203207Reviewed-by: default avatarAlexander Timin <altimin@chromium.org>
Reviewed-by: default avatarNasko Oskov <nasko@chromium.org>
Commit-Queue: Alexander Timin <altimin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#776537}
parent 704b0c4e
......@@ -43,8 +43,7 @@ DedicatedWorkerHost::DedicatedWorkerHost(
const url::Origin& creator_origin,
const network::CrossOriginEmbedderPolicy& cross_origin_embedder_policy,
mojo::PendingRemote<network::mojom::CrossOriginEmbedderPolicyReporter>
coep_reporter,
mojo::PendingReceiver<blink::mojom::DedicatedWorkerHost> host)
coep_reporter)
: service_(service),
id_(id),
worker_process_host_(worker_process_host),
......@@ -56,7 +55,6 @@ DedicatedWorkerHost::DedicatedWorkerHost(
// the worker script URL.
worker_origin_(creator_origin),
cross_origin_embedder_policy_(cross_origin_embedder_policy),
host_receiver_(this, std::move(host)),
coep_reporter_(std::move(coep_reporter)) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(worker_process_host_);
......
......@@ -26,7 +26,6 @@
#include "third_party/blink/public/mojom/wake_lock/wake_lock.mojom-forward.h"
#include "third_party/blink/public/mojom/websockets/websocket_connector.mojom-forward.h"
#include "third_party/blink/public/mojom/webtransport/quic_transport_connector.mojom-forward.h"
#include "third_party/blink/public/mojom/worker/dedicated_worker_host.mojom.h"
#include "third_party/blink/public/mojom/worker/dedicated_worker_host_factory.mojom.h"
#include "third_party/blink/public/mojom/worker/subresource_loader_updater.mojom.h"
#include "url/origin.h"
......@@ -46,8 +45,7 @@ class StoragePartitionImpl;
// A host for a single dedicated worker. It deletes itself upon Mojo
// disconnection from the worker in the renderer or when the RenderProcessHost
// of the worker is destroyed. This lives on the UI thread.
class DedicatedWorkerHost final : public blink::mojom::DedicatedWorkerHost,
public RenderProcessHostObserver {
class DedicatedWorkerHost final : public RenderProcessHostObserver {
public:
DedicatedWorkerHost(
DedicatedWorkerServiceImpl* service,
......@@ -58,8 +56,7 @@ class DedicatedWorkerHost final : public blink::mojom::DedicatedWorkerHost,
const url::Origin& creator_origin,
const network::CrossOriginEmbedderPolicy& cross_origin_embedder_policy,
mojo::PendingRemote<network::mojom::CrossOriginEmbedderPolicyReporter>
coep_reporter,
mojo::PendingReceiver<blink::mojom::DedicatedWorkerHost> host);
coep_reporter);
~DedicatedWorkerHost() final;
void BindBrowserInterfaceBrokerReceiver(
......@@ -197,7 +194,6 @@ class DedicatedWorkerHost final : public blink::mojom::DedicatedWorkerHost,
this};
mojo::Receiver<blink::mojom::BrowserInterfaceBroker> broker_receiver_{
&broker_};
mojo::Receiver<blink::mojom::DedicatedWorkerHost> host_receiver_;
// Indicates if subresource loaders of this worker support file URLs.
bool file_url_support_ = false;
......
......@@ -38,7 +38,6 @@ DedicatedWorkerHostFactoryImpl::~DedicatedWorkerHostFactoryImpl() = default;
void DedicatedWorkerHostFactoryImpl::CreateWorkerHost(
mojo::PendingReceiver<blink::mojom::BrowserInterfaceBroker> broker_receiver,
mojo::PendingReceiver<blink::mojom::DedicatedWorkerHost> host_receiver,
base::OnceCallback<void(const network::CrossOriginEmbedderPolicy&)>
callback) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
......@@ -71,8 +70,7 @@ void DedicatedWorkerHostFactoryImpl::CreateWorkerHost(
auto* host = new DedicatedWorkerHost(
service, service->GenerateNextDedicatedWorkerId(), worker_process_host,
creator_render_frame_host_id_, ancestor_render_frame_host_id_,
creator_origin_, cross_origin_embedder_policy_, std::move(coep_reporter),
std::move(host_receiver));
creator_origin_, cross_origin_embedder_policy_, std::move(coep_reporter));
host->BindBrowserInterfaceBrokerReceiver(std::move(broker_receiver));
}
......@@ -83,8 +81,8 @@ void DedicatedWorkerHostFactoryImpl::CreateWorkerHostAndStartScriptLoad(
blink::mojom::FetchClientSettingsObjectPtr
outside_fetch_client_settings_object,
mojo::PendingRemote<blink::mojom::BlobURLToken> blob_url_token,
mojo::PendingRemote<blink::mojom::DedicatedWorkerHostFactoryClient> client,
mojo::PendingReceiver<blink::mojom::DedicatedWorkerHost> host_receiver) {
mojo::PendingRemote<blink::mojom::DedicatedWorkerHostFactoryClient>
client) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (!base::FeatureList::IsEnabled(blink::features::kPlzDedicatedWorker)) {
mojo::ReportBadMessage("DWH_BROWSER_SCRIPT_FETCH_DISABLED");
......@@ -116,8 +114,7 @@ void DedicatedWorkerHostFactoryImpl::CreateWorkerHostAndStartScriptLoad(
auto* host = new DedicatedWorkerHost(
service, service->GenerateNextDedicatedWorkerId(), worker_process_host,
creator_render_frame_host_id_, ancestor_render_frame_host_id_,
creator_origin_, cross_origin_embedder_policy_, std::move(coep_reporter),
std::move(host_receiver));
creator_origin_, cross_origin_embedder_policy_, std::move(coep_reporter));
mojo::PendingRemote<blink::mojom::BrowserInterfaceBroker> broker;
host->BindBrowserInterfaceBrokerReceiver(
broker.InitWithNewPipeAndPassReceiver());
......
......@@ -36,7 +36,6 @@ class CONTENT_EXPORT DedicatedWorkerHostFactoryImpl
void CreateWorkerHost(
mojo::PendingReceiver<blink::mojom::BrowserInterfaceBroker>
broker_receiver,
mojo::PendingReceiver<blink::mojom::DedicatedWorkerHost> host_receiver,
base::OnceCallback<void(const network::CrossOriginEmbedderPolicy&)>
callback) override;
......@@ -48,9 +47,7 @@ class CONTENT_EXPORT DedicatedWorkerHostFactoryImpl
outside_fetch_client_settings_object,
mojo::PendingRemote<blink::mojom::BlobURLToken> blob_url_token,
mojo::PendingRemote<blink::mojom::DedicatedWorkerHostFactoryClient>
client,
mojo::PendingReceiver<blink::mojom::DedicatedWorkerHost> host_receiver)
override;
client) override;
private:
// The ID of the RenderProcessHost where the worker will live.
......
......@@ -49,12 +49,10 @@ class MockDedicatedWorker
/*script_url=*/GURL(), network::mojom::CredentialsMode::kSameOrigin,
blink::mojom::FetchClientSettingsObject::New(),
mojo::PendingRemote<blink::mojom::BlobURLToken>(),
receiver_.BindNewPipeAndPassRemote(),
remote_host_.BindNewPipeAndPassReceiver());
receiver_.BindNewPipeAndPassRemote());
} else {
factory_->CreateWorkerHost(
browser_interface_broker_.BindNewPipeAndPassReceiver(),
remote_host_.BindNewPipeAndPassReceiver(),
base::BindOnce([](const network::CrossOriginEmbedderPolicy&) {}));
}
}
......@@ -91,7 +89,6 @@ class MockDedicatedWorker
mojo::Remote<blink::mojom::DedicatedWorkerHostFactory> factory_;
mojo::Remote<blink::mojom::BrowserInterfaceBroker> browser_interface_broker_;
mojo::Remote<blink::mojom::DedicatedWorkerHost> remote_host_;
};
class DedicatedWorkerServiceImplTest
......
......@@ -41,7 +41,7 @@ void DedicatedWorkerHostFactoryClient::CreateWorkerHostDeprecated(
browser_interface_broker;
factory_->CreateWorkerHost(
browser_interface_broker.InitWithNewPipeAndPassReceiver(),
remote_host_.BindNewPipeAndPassReceiver(), std::move(callback));
std::move(callback));
OnWorkerHostCreated(std::move(browser_interface_broker));
}
......@@ -56,8 +56,7 @@ void DedicatedWorkerHostFactoryClient::CreateWorkerHost(
factory_->CreateWorkerHostAndStartScriptLoad(
script_url, credentials_mode,
FetchClientSettingsObjectFromWebToMojom(fetch_client_settings_object),
std::move(blob_url_token), receiver_.BindNewPipeAndPassRemote(),
remote_host_.BindNewPipeAndPassReceiver());
std::move(blob_url_token), receiver_.BindNewPipeAndPassRemote());
}
scoped_refptr<blink::WebWorkerFetchContext>
......
......@@ -12,7 +12,6 @@
#include "third_party/blink/public/common/browser_interface_broker_proxy.h"
#include "third_party/blink/public/mojom/renderer_preference_watcher.mojom-forward.h"
#include "third_party/blink/public/mojom/renderer_preferences.mojom-forward.h"
#include "third_party/blink/public/mojom/worker/dedicated_worker_host.mojom.h"
#include "third_party/blink/public/mojom/worker/dedicated_worker_host_factory.mojom.h"
#include "third_party/blink/public/platform/web_dedicated_worker_host_factory_client.h"
......@@ -91,7 +90,6 @@ class DedicatedWorkerHostFactoryClient final
mojo::Remote<blink::mojom::DedicatedWorkerHostFactory> factory_;
mojo::Receiver<blink::mojom::DedicatedWorkerHostFactoryClient> receiver_{
this};
mojo::Remote<blink::mojom::DedicatedWorkerHost> remote_host_;
};
} // namespace content
......
......@@ -167,7 +167,6 @@ mojom("mojom_platform") {
"websockets/websocket_connector.mojom",
"webtransport/quic_transport_connector.mojom",
"window_features/window_features.mojom",
"worker/dedicated_worker_host.mojom",
"worker/shared_worker_client.mojom",
"worker/shared_worker_creation_context_type.mojom",
"worker/shared_worker_host.mojom",
......
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
module blink.mojom;
import "third_party/blink/public/mojom/frame/lifecycle.mojom";
// Each dedicated worker has a corresponding host that is implemented in
// the browser process.
// TODO(altimin): Remove this interface.
interface DedicatedWorkerHost {
};
......@@ -11,7 +11,6 @@ import "third_party/blink/public/mojom/browser_interface_broker.mojom";
import "third_party/blink/public/mojom/loader/fetch_client_settings_object.mojom";
import "third_party/blink/public/mojom/worker/subresource_loader_updater.mojom";
import "third_party/blink/public/mojom/loader/url_loader_factory_bundle.mojom";
import "third_party/blink/public/mojom/worker/dedicated_worker_host.mojom";
import "third_party/blink/public/mojom/worker/worker_main_script_load_params.mojom";
import "third_party/blink/public/mojom/service_worker/controller_service_worker.mojom";
import "third_party/blink/public/mojom/service_worker/service_worker_container.mojom";
......@@ -76,8 +75,7 @@ interface DedicatedWorkerHostFactory {
// to provide the worker access to mojo interfaces.
CreateWorkerHost(
pending_receiver<blink.mojom.BrowserInterfaceBroker>
browser_interface_broker,
pending_receiver<DedicatedWorkerHost> host) =>
browser_interface_broker) =>
(network.mojom.CrossOriginEmbedderPolicy parent_coep);
// PlzDedicatedWorker:
......@@ -96,6 +94,5 @@ interface DedicatedWorkerHostFactory {
blink.mojom.FetchClientSettingsObject
outside_fetch_client_settings_object,
pending_remote<blink.mojom.BlobURLToken>? blob_url_token,
pending_remote<DedicatedWorkerHostFactoryClient> client,
pending_receiver<DedicatedWorkerHost> host);
pending_remote<DedicatedWorkerHostFactoryClient> client);
};
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