OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CONTENT_RENDERER_SCHEDULER_RENDERER_SCHEDULER_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_SCHEDULER_RENDERER_SCHEDULER_IMPL_H_ |
6 #define CONTENT_RENDERER_SCHEDULER_RENDERER_SCHEDULER_IMPL_H_ | 6 #define CONTENT_RENDERER_SCHEDULER_RENDERER_SCHEDULER_IMPL_H_ |
7 | 7 |
8 #include "base/atomicops.h" | 8 #include "base/atomicops.h" |
9 #include "base/synchronization/lock.h" | 9 #include "base/synchronization/lock.h" |
10 #include "base/threading/thread_checker.h" | 10 #include "base/threading/thread_checker.h" |
11 #include "cc/test/test_now_source.h" | 11 #include "cc/test/test_now_source.h" |
12 #include "content/renderer/scheduler/cancelable_closure_holder.h" | 12 #include "content/renderer/scheduler/cancelable_closure_holder.h" |
13 #include "content/renderer/scheduler/renderer_scheduler.h" | 13 #include "content/renderer/scheduler/renderer_scheduler.h" |
14 #include "content/renderer/scheduler/single_thread_idle_task_runner.h" | 14 #include "content/renderer/scheduler/single_thread_idle_task_runner.h" |
15 #include "content/renderer/scheduler/task_queue_manager.h" | 15 #include "content/renderer/scheduler/task_queue_manager.h" |
16 | 16 |
17 namespace base { | 17 namespace base { |
18 namespace trace_event { | 18 namespace trace_event { |
19 class ConvertableToTraceFormat; | 19 class ConvertableToTraceFormat; |
20 } | 20 } |
21 | |
22 // TODO(ssid): remove these aliases after the tracing clients are moved to the | |
23 // new trace_event namespace. See crbug.com/451032. ETA: March 2015 | |
24 namespace debug { | |
25 using ::base::trace_event::ConvertableToTraceFormat; | |
26 } | 21 } |
27 } // namespace base | |
28 | 22 |
29 namespace content { | 23 namespace content { |
30 | 24 |
31 class RendererTaskQueueSelector; | 25 class RendererTaskQueueSelector; |
32 | 26 |
33 class CONTENT_EXPORT RendererSchedulerImpl : public RendererScheduler { | 27 class CONTENT_EXPORT RendererSchedulerImpl : public RendererScheduler { |
34 public: | 28 public: |
35 RendererSchedulerImpl( | 29 RendererSchedulerImpl( |
36 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner); | 30 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner); |
37 ~RendererSchedulerImpl() override; | 31 ~RendererSchedulerImpl() override; |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 bool IsSet() const; | 77 bool IsSet() const; |
84 | 78 |
85 private: | 79 private: |
86 base::subtle::Atomic32 flag_; | 80 base::subtle::Atomic32 flag_; |
87 base::Lock* write_lock_; // Not owned. | 81 base::Lock* write_lock_; // Not owned. |
88 | 82 |
89 DISALLOW_COPY_AND_ASSIGN(PollableNeedsUpdateFlag); | 83 DISALLOW_COPY_AND_ASSIGN(PollableNeedsUpdateFlag); |
90 }; | 84 }; |
91 | 85 |
92 // Returns the serialized scheduler state for tracing. | 86 // Returns the serialized scheduler state for tracing. |
93 scoped_refptr<base::debug::ConvertableToTraceFormat> AsValueLocked( | 87 scoped_refptr<base::trace_event::ConvertableToTraceFormat> AsValueLocked( |
94 base::TimeTicks optional_now) const; | 88 base::TimeTicks optional_now) const; |
95 static const char* TaskQueueIdToString(QueueId queue_id); | 89 static const char* TaskQueueIdToString(QueueId queue_id); |
96 static const char* PolicyToString(Policy policy); | 90 static const char* PolicyToString(Policy policy); |
97 | 91 |
98 // The time we should stay in CompositorPriority mode for after a touch event. | 92 // The time we should stay in CompositorPriority mode for after a touch event. |
99 static const int kCompositorPriorityAfterTouchMillis = 100; | 93 static const int kCompositorPriorityAfterTouchMillis = 100; |
100 | 94 |
101 // IdleTaskDeadlineSupplier Implementation: | 95 // IdleTaskDeadlineSupplier Implementation: |
102 void CurrentIdleTaskDeadlineCallback(base::TimeTicks* deadline_out) const; | 96 void CurrentIdleTaskDeadlineCallback(base::TimeTicks* deadline_out) const; |
103 | 97 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 | 144 |
151 base::WeakPtr<RendererSchedulerImpl> weak_renderer_scheduler_ptr_; | 145 base::WeakPtr<RendererSchedulerImpl> weak_renderer_scheduler_ptr_; |
152 base::WeakPtrFactory<RendererSchedulerImpl> weak_factory_; | 146 base::WeakPtrFactory<RendererSchedulerImpl> weak_factory_; |
153 | 147 |
154 DISALLOW_COPY_AND_ASSIGN(RendererSchedulerImpl); | 148 DISALLOW_COPY_AND_ASSIGN(RendererSchedulerImpl); |
155 }; | 149 }; |
156 | 150 |
157 } // namespace content | 151 } // namespace content |
158 | 152 |
159 #endif // CONTENT_RENDERER_SCHEDULER_RENDERER_SCHEDULER_IMPL_H_ | 153 #endif // CONTENT_RENDERER_SCHEDULER_RENDERER_SCHEDULER_IMPL_H_ |
OLD | NEW |