File: v8_contexts.mojom

package info (click to toggle)
chromium 139.0.7258.138-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 6,120,676 kB
  • sloc: cpp: 35,100,869; ansic: 7,163,530; javascript: 4,103,002; python: 1,436,920; asm: 946,517; xml: 746,709; pascal: 187,653; perl: 88,691; sh: 88,436; objc: 79,953; sql: 51,488; cs: 44,583; fortran: 24,137; makefile: 22,147; tcl: 15,277; php: 13,980; yacc: 8,984; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (59 lines) | stat: -rw-r--r-- 2,510 bytes parent folder | download | duplicates (8)
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

module performance_manager.mojom;

import "third_party/blink/public/mojom/tokens/tokens.mojom";

// Stores information about an iframe element from the point of view of the
// document that hosts the iframe. This is used for purely informational
// purposes in the performance.measureUserAgentSpecificMemory API to identify
// an iframe in memory usage reports.
struct IframeAttributionData {
  // The value of the "id" attribute associated with the iframe element.
  string? id;
  // The value of the "src" attribute associated with the iframe element. We
  // don't use an URL because we don't need to parse this, or otherwise use
  // it as an URL, and URL objects have a large memory footprint.
  string? src;
};

// Identifies a V8Context type. Note that this roughly corresponds to the
// world types defined in blink, but with some simplifications.
enum V8ContextWorldType {
  // The main world, corresponding to a frame / document.
  kMain,
  // Corresponds to the main world of a worker or worklet.
  kWorkerOrWorklet,
  // Corresponds to a ShadowRealm.
  kShadowRealm,
  // Corresponds to an extension. Will have a stable extension ID.
  kExtension,
  // Corresponds to a non-extension isolated world. Will have a human readable
  // name.
  kIsolated,
  // Corresponds to the devtools inspector. Will not have a human readable
  // name or a stable id.
  kInspector,
  // Corresponds to the regexp world. This world is unique in that it is per
  // v8::Isolate, and not associated with any individual execution context.
  // Will not have a human-readable name or stable id.
  kRegExp,
};

// Information describing a V8 Context. A context is a unit of accounting for
// resource usage, and corresponds to a "world" in Blink parlance.
struct V8ContextDescription {
  // The unique token that names the world.
  blink.mojom.V8ContextToken token;
  // The type of this world.
  V8ContextWorldType world_type;
  // Identifies this world. Only set for extension and isolated worlds. For
  // extension worlds this corresponds to the stable extension ID. For other
  // isolated worlds this is a human-readable description.
  string? world_name;
  // The identity of the execution context that this V8Context is associated
  // with. This is specified for all world types, except kRegExp worlds.
  blink.mojom.ExecutionContextToken? execution_context_token;
};