OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_CHILD_SCHEDULER_HELPER_H_ | 5 #ifndef THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_CHILD_SCHEDULER_HELPER_H_ |
6 #define THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_CHILD_SCHEDULER_HELPER_H_ | 6 #define THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_CHILD_SCHEDULER_HELPER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 class BLINK_PLATFORM_EXPORT SchedulerHelper | 21 class BLINK_PLATFORM_EXPORT SchedulerHelper |
22 : public TaskQueueManager::Observer { | 22 : public TaskQueueManager::Observer { |
23 public: | 23 public: |
24 // Category strings must have application lifetime (statics or | 24 // Category strings must have application lifetime (statics or |
25 // literals). They may not include " chars. | 25 // literals). They may not include " chars. |
26 SchedulerHelper( | 26 SchedulerHelper( |
27 scoped_refptr<SchedulerTqmDelegate> task_queue_manager_delegate, | 27 scoped_refptr<SchedulerTqmDelegate> task_queue_manager_delegate, |
28 const char* tracing_category, | 28 const char* tracing_category, |
29 const char* disabled_by_default_tracing_category, | 29 const char* disabled_by_default_tracing_category, |
30 const char* disabled_by_default_verbose_tracing_category); | 30 const char* disabled_by_default_verbose_tracing_category); |
31 SchedulerHelper( | |
32 scoped_refptr<SchedulerTqmDelegate> task_queue_manager_delegate, | |
33 const char* tracing_category, | |
34 const char* disabled_by_default_tracing_category, | |
35 const char* disabled_by_default_verbose_tracing_category, | |
36 TaskQueue::Spec default_task_queue_spec); | |
37 ~SchedulerHelper() override; | 31 ~SchedulerHelper() override; |
38 | 32 |
39 // There is a small overhead to recording task delay histograms, we may not | |
40 // wish to do this on all threads. | |
41 void SetRecordTaskDelayHistograms(bool record_task_delay_histograms); | |
42 | |
43 // TaskQueueManager::Observer implementation: | 33 // TaskQueueManager::Observer implementation: |
44 void OnUnregisterTaskQueue(const scoped_refptr<TaskQueue>& queue) override; | 34 void OnUnregisterTaskQueue(const scoped_refptr<TaskQueue>& queue) override; |
45 void OnTriedToExecuteBlockedTask(const TaskQueue& queue, | 35 void OnTriedToExecuteBlockedTask(const TaskQueue& queue, |
46 const base::PendingTask& task) override; | 36 const base::PendingTask& task) override; |
47 | 37 |
48 // Returns the default task runner. | 38 // Returns the default task runner. |
49 scoped_refptr<TaskQueue> DefaultTaskRunner(); | 39 scoped_refptr<TaskQueue> DefaultTaskRunner(); |
50 | 40 |
51 // Returns the control task runner. Tasks posted to this runner are executed | 41 // Returns the control task runner. Tasks posted to this runner are executed |
52 // with the highest priority. Care must be taken to avoid starvation of other | 42 // with the highest priority. Care must be taken to avoid starvation of other |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 const char* tracing_category_; | 113 const char* tracing_category_; |
124 const char* disabled_by_default_tracing_category_; | 114 const char* disabled_by_default_tracing_category_; |
125 | 115 |
126 DISALLOW_COPY_AND_ASSIGN(SchedulerHelper); | 116 DISALLOW_COPY_AND_ASSIGN(SchedulerHelper); |
127 }; | 117 }; |
128 | 118 |
129 } // namespace scheduler | 119 } // namespace scheduler |
130 } // namespace blink | 120 } // namespace blink |
131 | 121 |
132 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_CHILD_SCHEDULER_HELPER_H
_ | 122 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_CHILD_SCHEDULER_HELPER_H
_ |
OLD | NEW |