File: lifecycle_unit_state.mojom

package info (click to toggle)
chromium 139.0.7258.127-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 6,122,068 kB
  • sloc: cpp: 35,100,771; 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 (67 lines) | stat: -rw-r--r-- 2,556 bytes parent folder | download | duplicates (6)
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
60
61
62
63
64
65
66
67
// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

module mojom;

// Note that these states are emitted via UKMs, so the integer values should
// remain consistent.
enum LifecycleUnitState {
  // The LifecycleUnit is alive and active with no CPU throttling.
  ACTIVE = 0,
  // Deprecated: THROTTLED = 1,
  // Deprecated: PENDING_FREEZE = 2,
  // The LifecycleUnit is frozen.
  FROZEN = 3,
  // Deprecated: PENDING_DISCARD = 4,
  // The LifecycleUnit is discarded, and is consuming no system resources.
  DISCARDED = 5,
  // Deprecated: PENDING_UNFREEZE = 6,
};

// Indicates the loading state of a lifecycle unit, orthogonal to the basic
// lifecycle state. Note that these values are written to logs and histograms
// so need to remain consistent.
enum LifecycleUnitLoadingState {
  // The LifecycleUnit is not yet loaded, or loading was attempted but failed.
  UNLOADED = 0,
  // The LifecycleUnit is loading.
  LOADING = 1,
  // The LifecycleUnit is loaded.
  LOADED = 2,
};

// An enumeration of reasons why a lifecycle state change was applied. These are
// also emitted via UKM so need to remain stable.
enum LifecycleUnitStateChangeReason {
  // Policy in the browser decided to initiate the state change.
  BROWSER_INITIATED = 0,
  // Policy in the renderer decided to initiate the state change.
  RENDERER_INITIATED = 1,
  // A system wide memory pressure condition initiated the state change.
  SYSTEM_MEMORY_PRESSURE = 2,
  // Initiated by an extension.
  EXTENSION_INITIATED = 3,
  // Initiated by a user action (e.g. changing focus, clicking reload).
  USER_INITIATED = 4,
};

// An enumeration of reasons for a discard.
enum LifecycleUnitDiscardReason {
  // The discard is requested from outside of TabManager (e.g. by an extension).
  EXTERNAL = 0,
  // The discard is requested urgently by TabManager when the system is in a
  // critical condition.
  URGENT = 1,
  // The discard is requested proactively by PerformanceManager to free up
  // memory before the system is under memory pressure, such as when Memory
  // Saver Mode initiates a discard.
  PROACTIVE = 2,
  // The discard is requested by PerformanceDetectionManager because the
  // manager has detected intensive resource usage and suggests discarding
  // certain tabs in an attempt to improve resource usage.
  SUGGESTED = 3,
  // The discard is requested by FreezingPolicy for a frozen tab that grew its
  // memory usage above a threshold.
  FROZEN_WITH_GROWING_MEMORY = 4,
};