• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #include "base/task/sequence_manager/sequence_manager.h"
6 
7 namespace base {
8 namespace sequence_manager {
9 
MetricRecordingSettings()10 SequenceManager::MetricRecordingSettings::MetricRecordingSettings() {}
11 
MetricRecordingSettings(bool cpu_time_for_each_task,double task_thread_time_sampling_rate)12 SequenceManager::MetricRecordingSettings::MetricRecordingSettings(
13     bool cpu_time_for_each_task,
14     double task_thread_time_sampling_rate)
15     : records_cpu_time_for_each_task(base::ThreadTicks::IsSupported() &&
16                                      cpu_time_for_each_task),
17       task_sampling_rate_for_recording_cpu_time(
18           task_thread_time_sampling_rate) {
19   if (records_cpu_time_for_each_task)
20     task_sampling_rate_for_recording_cpu_time = 1;
21   if (!base::ThreadTicks::IsSupported())
22     task_sampling_rate_for_recording_cpu_time = 0;
23 }
24 
25 }  // namespace sequence_manager
26 }  // namespace base
27