| 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 CONTENT_RENDERER_SCHEDULER_BASE_TASK_QUEUE_IMPL_H_ | 5 #ifndef THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_IMPL_H_ |
| 6 #define CONTENT_RENDERER_SCHEDULER_BASE_TASK_QUEUE_IMPL_H_ | 6 #define THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_IMPL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <set> | 11 #include <set> |
| 12 | 12 |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/pending_task.h" | 14 #include "base/pending_task.h" |
| 15 #include "base/threading/thread_checker.h" | 15 #include "base/threading/thread_checker.h" |
| 16 #include "base/trace_event/trace_event.h" | 16 #include "base/trace_event/trace_event.h" |
| 17 #include "base/trace_event/trace_event_argument.h" | 17 #include "base/trace_event/trace_event_argument.h" |
| 18 #include "components/scheduler/base/enqueue_order.h" | 18 #include "platform/scheduler/base/enqueue_order.h" |
| 19 #include "components/scheduler/base/task_queue.h" | 19 #include "public/platform/scheduler/base/task_queue.h" |
| 20 #include "components/scheduler/scheduler_export.h" | |
| 21 | 20 |
| 21 namespace blink { |
| 22 namespace scheduler { | 22 namespace scheduler { |
| 23 class LazyNow; | 23 class LazyNow; |
| 24 class TimeDomain; | 24 class TimeDomain; |
| 25 class TaskQueueManager; | 25 class TaskQueueManager; |
| 26 | 26 |
| 27 namespace internal { | 27 namespace internal { |
| 28 class WorkQueue; | 28 class WorkQueue; |
| 29 class WorkQueueSets; | 29 class WorkQueueSets; |
| 30 | 30 |
| 31 class SCHEDULER_EXPORT TaskQueueImpl final : public TaskQueue { | 31 class BLINK_PLATFORM_EXPORT TaskQueueImpl final : public TaskQueue { |
| 32 public: | 32 public: |
| 33 TaskQueueImpl(TaskQueueManager* task_queue_manager, | 33 TaskQueueImpl(TaskQueueManager* task_queue_manager, |
| 34 TimeDomain* time_domain, | 34 TimeDomain* time_domain, |
| 35 const Spec& spec, | 35 const Spec& spec, |
| 36 const char* disabled_by_default_tracing_category, | 36 const char* disabled_by_default_tracing_category, |
| 37 const char* disabled_by_default_verbose_tracing_category); | 37 const char* disabled_by_default_verbose_tracing_category); |
| 38 | 38 |
| 39 class SCHEDULER_EXPORT Task : public base::PendingTask { | 39 class BLINK_PLATFORM_EXPORT Task : public base::PendingTask { |
| 40 public: | 40 public: |
| 41 Task(); | 41 Task(); |
| 42 Task(const tracked_objects::Location& posted_from, | 42 Task(const tracked_objects::Location& posted_from, |
| 43 const base::Closure& task, | 43 const base::Closure& task, |
| 44 base::TimeTicks desired_run_time, | 44 base::TimeTicks desired_run_time, |
| 45 EnqueueOrder sequence_number, | 45 EnqueueOrder sequence_number, |
| 46 bool nestable); | 46 bool nestable); |
| 47 | 47 |
| 48 Task(const tracked_objects::Location& posted_from, | 48 Task(const tracked_objects::Location& posted_from, |
| 49 const base::Closure& task, | 49 const base::Closure& task, |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 WakeupPolicy wakeup_policy() const { | 117 WakeupPolicy wakeup_policy() const { |
| 118 DCHECK(main_thread_checker_.CalledOnValidThread()); | 118 DCHECK(main_thread_checker_.CalledOnValidThread()); |
| 119 return wakeup_policy_; | 119 return wakeup_policy_; |
| 120 } | 120 } |
| 121 | 121 |
| 122 const char* GetName() const override; | 122 const char* GetName() const override; |
| 123 | 123 |
| 124 void AsValueInto(base::trace_event::TracedValue* state) const; | 124 void AsValueInto(base::trace_event::TracedValue* state) const; |
| 125 | 125 |
| 126 bool GetQuiescenceMonitored() const { return should_monitor_quiescence_; } | 126 bool GetQuiescenceMonitored() const { return should_monitor_quiescence_; } |
| 127 bool GetShouldNotifyObservers() const { | 127 bool GetShouldNotifyObservers() const { return should_notify_observers_; } |
| 128 return should_notify_observers_; | |
| 129 } | |
| 130 | 128 |
| 131 void NotifyWillProcessTask(const base::PendingTask& pending_task); | 129 void NotifyWillProcessTask(const base::PendingTask& pending_task); |
| 132 void NotifyDidProcessTask(const base::PendingTask& pending_task); | 130 void NotifyDidProcessTask(const base::PendingTask& pending_task); |
| 133 | 131 |
| 134 // Can be called on any thread. | 132 // Can be called on any thread. |
| 135 static const char* PumpPolicyToString(TaskQueue::PumpPolicy pump_policy); | 133 static const char* PumpPolicyToString(TaskQueue::PumpPolicy pump_policy); |
| 136 | 134 |
| 137 // Can be called on any thread. | 135 // Can be called on any thread. |
| 138 static const char* WakeupPolicyToString( | 136 static const char* WakeupPolicyToString( |
| 139 TaskQueue::WakeupPolicy wakeup_policy); | 137 TaskQueue::WakeupPolicy wakeup_policy); |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 const WakeupPolicy wakeup_policy_; | 296 const WakeupPolicy wakeup_policy_; |
| 299 const bool should_monitor_quiescence_; | 297 const bool should_monitor_quiescence_; |
| 300 const bool should_notify_observers_; | 298 const bool should_notify_observers_; |
| 301 const bool should_report_when_execution_blocked_; | 299 const bool should_report_when_execution_blocked_; |
| 302 | 300 |
| 303 DISALLOW_COPY_AND_ASSIGN(TaskQueueImpl); | 301 DISALLOW_COPY_AND_ASSIGN(TaskQueueImpl); |
| 304 }; | 302 }; |
| 305 | 303 |
| 306 } // namespace internal | 304 } // namespace internal |
| 307 } // namespace scheduler | 305 } // namespace scheduler |
| 306 } // namespace blink |
| 308 | 307 |
| 309 #endif // CONTENT_RENDERER_SCHEDULER_BASE_TASK_QUEUE_IMPL_H_ | 308 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_BASE_TASK_QUEUE_IMPL_H_ |
| OLD | NEW |