blob: a0b1745bd26b8c27d13053ede9a48a23f68fa948 [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 "third_party/blink/public/mojom/web_feature/web_feature.mojom";
import "third_party/blink/public/mojom/devtools/devtools_agent.mojom";
// Each shared worker has a corresponding host. The host controls the lifetime
// of the shared worker. This interface is used by the shared worker to talk to
// its host.
interface SharedWorkerHost {
// Called in response to SharedWorker's Connect method. The |connection_id|
// parameter is the same value passed to the Connect method.
OnConnected(int32 connection_id);
// Indicates that the shared worker self-closed. This should trigger the host
// to terminate the shared worker.
OnContextClosed();
// Indicates that the shared worker is ready for inspection,
// passes a DevToolsAgent interface for this worker and requests
// a corresponding host. See DevToolsAgent for details.
OnReadyForInspection(pending_remote<blink.mojom.DevToolsAgent> agent,
pending_receiver<blink.mojom.DevToolsAgentHost> agent_host);
// Indicates that the script failed to load.
// If |error_message| is not empty, it will be ptinted in the creator frame's
// console.
OnScriptLoadFailed(string error_message);
// Indicates that the shared worker used a feature. This is intended to be
// logged by the client-side feature logging infrastructure.
OnFeatureUsed(WebFeature feature);
};