• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2021 The Chromium Authors
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 BASE_FUCHSIA_SCHEDULER_H_
6 #define BASE_FUCHSIA_SCHEDULER_H_
7 
8 #include "base/time/time.h"
9 
10 namespace base {
11 
12 // Scheduling interval to use for realtime audio threads.
13 // TODO(crbug.com/42050308): Add scheduling period to Thread::Options and remove
14 // this constants.
15 constexpr TimeDelta kAudioSchedulingPeriod = Milliseconds(10);
16 
17 // Request 30% max CPU deadline utilization for an audio thread.
18 // TODO(crbug.com/42050235): A different value may need to be used for WebAudio
19 // threads (see media::FuchsiaAudioOutputDevice). A higher capacity may need to
20 // be allocated in that case.
21 constexpr float kAudioSchedulingCapacity = 0.3;
22 
23 // Scheduling interval to use for display threads.
24 // TODO(crbug.com/42050308): Add scheduling period to Thread::Options and remove
25 // this constants.
26 constexpr TimeDelta kDisplaySchedulingPeriod = Seconds(1) / 60;
27 
28 // Request 50% max CPU deadline utilization for a display thread.
29 // TODO(crbug.com/40750845): Currently DISPLAY priority is not enabled for any
30 // thread on Fuchsia. The value below will need to be fine-tuned when it's
31 // enabled.
32 const float kDisplaySchedulingCapacity = 0.5;
33 
34 }  // namespace base
35 
36 #endif  // BASE_FUCHSIA_SCHEDULER_H_
37