blob: 79e6cc04f1f3225461d67a39393af0b905dc9acc [file] [log] [blame]
// Copyright 2017 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 "mojo/public/mojom/base/unguessable_token.mojom";
import "services/network/public/mojom/url_loader_factory.mojom";
import "services/service_manager/public/mojom/interface_provider.mojom";
import "third_party/blink/public/mojom/loader/url_loader_factory_bundle.mojom";
import "third_party/blink/public/mojom/renderer_preference_watcher.mojom";
import "third_party/blink/public/mojom/renderer_preferences.mojom";
import "third_party/blink/public/mojom/service_worker/controller_service_worker.mojom";
import "third_party/blink/public/mojom/service_worker/service_worker_provider.mojom";
import "third_party/blink/public/mojom/worker/shared_worker.mojom";
import "third_party/blink/public/mojom/worker/shared_worker_host.mojom";
import "third_party/blink/public/mojom/worker/shared_worker_info.mojom";
import "third_party/blink/public/mojom/worker/worker_content_settings_proxy.mojom";
import "third_party/blink/public/mojom/worker/worker_main_script_load_params.mojom";
// The name of the InterfaceProviderSpec in service manifests used by the
// frame tree to expose shared-worker-specific interfaces between renderer and
// browser.
const string kNavigation_SharedWorkerSpec = "navigation:shared_worker";
// This interface is used to instantiate a shared worker. It is exported from a
// child process where the shared worker should run.
interface SharedWorkerFactory {
// Create a new shared worker. The |host| interface receives events from the
// shared worker.
//
// TODO(sammc): Change shared workers to obtain |content_settings| via
// |interface_provider| instead of receiving plumbing it here.
CreateSharedWorker(
SharedWorkerInfo info,
bool pause_on_start,
mojo_base.mojom.UnguessableToken devtools_worker_token,
RendererPreferences renderer_preferences,
RendererPreferenceWatcher& preference_watcher_request,
WorkerContentSettingsProxy content_settings,
// The info about the service worker host in the browser process that
// provides support for this shared worker to be a service worker client.
ServiceWorkerProviderInfoForWorker service_worker_provider_info,
// NetworkService:
// The ID of the AppCacheHost in the browser process that serves resources
// for this shared worker. This is kAppCacheNoHostId when NetworkService
// is disabled or AppCache doesn't serve resources for this shared worker.
int32 appcache_host_id,
// Non-NetworkService:
// The URLLoaderFactory to use to request the shared worker's script
// (just the main script resource; importScripts() should go through the
// usual loader or the controller service worker if appropriate).
//
// This is only non-null when NetworkService is disabled.
network.mojom.URLLoaderFactory? main_script_loader_factory,
// NetworkService (PlzWorker):
// Used for passing a main script pre-requested by the browser process and
// its redirect information.
WorkerMainScriptLoadParams? main_script_load_params,
// NetworkService:
// When the Network Service is enabled, |subresource_loader_factories|
// may also be provided a means for the shared worker to load
// subresources where applicable. For example, this allows the shared
// worker to load chrome-extension:// URLs which the renderer's default
// loader factory can't load.
URLLoaderFactoryBundle? subresource_loader_factories,
// NetworkService (PlzWorker):
// Used for setting ServiceWorkerContainer#controller. This is null when
// NetworkService is disabled or there is no controller service worker.
//
// In non-NetworkService, the controller is sent via
// ServiceWorkerContainer.SetController().
ControllerServiceWorkerInfo? controller_info,
SharedWorkerHost host,
SharedWorker& shared_worker,
service_manager.mojom.InterfaceProvider interface_provider);
};