1 // Copyright 2018 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_SCHEDULER_PUBLIC_SCHEDULING_LIFECYCLE_STATE_H_ 6 #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_SCHEDULER_PUBLIC_SCHEDULING_LIFECYCLE_STATE_H_ 7 8 namespace blink { 9 namespace scheduler { 10 11 // The scheduling state of the frame which is communicated to observers. 12 // It's closely related to Web Lifecycle[1] states and should be distingushed 13 // from DocumentLifecycle. 14 // 15 // [1] https://wicg.github.io/page-lifecycle/spec.html. 16 enum class SchedulingLifecycleState { 17 // Frame is active and should not be throttled. 18 kNotThrottled, 19 // Frame has just been backgrounded and can be throttled non-aggressively. 20 kHidden, 21 // Frame spent some time in background and can be fully throttled. 22 kThrottled, 23 // Frame is stopped, no tasks associated with it can run. 24 kStopped, 25 }; 26 27 const char* SchedulingLifecycleStateToString(SchedulingLifecycleState state); 28 29 } // namespace scheduler 30 } // namespace blink 31 32 #endif // THIRD_PARTY_BLINK_RENDERER_PLATFORM_SCHEDULER_PUBLIC_SCHEDULING_LIFECYCLE_STATE_H_ 33