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,
};
|