| // Copyright 2018 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 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, |
| // The LifecycleUnit is currently being CPU throttled. |
| THROTTLED = 1, |
| // The LifecycleUnit is currently transitioning to a FROZEN state. |
| PENDING_FREEZE = 2, |
| // The LifecycleUnit is frozen. |
| FROZEN = 3, |
| // The LifecycleUnit is currently transitioning to a DISCARDED state. |
| PENDING_DISCARD = 4, |
| // The LifecycleUnit is discarded, and is consuming no system resources. |
| DISCARDED = 5, |
| // The LifecycleUnit is currently transitioning from the FROZEN state to the |
| // ACTIVE state. |
| 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 proactively by TabManager when the system is in a |
| // good state. |
| PROACTIVE = 1, |
| // The discard is requested urgently by TabManager when the system is in a |
| // critical condition. |
| URGENT = 2, |
| }; |