summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/public/mojom/worker/shared_worker_client.mojom
blob: 709ddebc14f64a1ddd28234bef902f2fc64facdc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// 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/worker/shared_worker_creation_context_type.mojom";
import "third_party/blink/public/platform/web_feature.mojom";

// An interface used by clients (e.g., the renderer where "new SharedWorker()"
// was invoked) to observe events from a shared worker.
interface SharedWorkerClient {
  // Indicates that the shared worker process has started (or may have already
  // been started). The shared worker script is not necessarily loaded yet.
  // This event will be followed by either OnConnected or OnScriptLoadFailed.
  OnCreated(SharedWorkerCreationContextType creation_context_type);

  // Indicates that the shared worker process is up and running, script loaded.
  OnConnected(array<WebFeature> features_used);

  // Indicates that the shared worker script failed to load.
  OnScriptLoadFailed();

  // Indicates that the shared worker used a feature. This is intended to be
  // logged by the client-side feature logging infrastructure.
  OnFeatureUsed(WebFeature feature);
};