| 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 COMPONENTS_SCHEDULER_RENDERER_THROTTLING_HELPER_H_ | 5 #ifndef COMPONENTS_SCHEDULER_RENDERER_THROTTLING_HELPER_H_ |
| 6 #define COMPONENTS_SCHEDULER_RENDERER_THROTTLING_HELPER_H_ | 6 #define COMPONENTS_SCHEDULER_RENDERER_THROTTLING_HELPER_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 public: | 23 public: |
| 24 ThrottlingHelper(RendererSchedulerImpl* renderer_scheduler, | 24 ThrottlingHelper(RendererSchedulerImpl* renderer_scheduler, |
| 25 const char* tracing_category); | 25 const char* tracing_category); |
| 26 | 26 |
| 27 ~ThrottlingHelper() override; | 27 ~ThrottlingHelper() override; |
| 28 | 28 |
| 29 // TimeDomain::Observer implementation: | 29 // TimeDomain::Observer implementation: |
| 30 void OnTimeDomainHasImmediateWork() override; | 30 void OnTimeDomainHasImmediateWork() override; |
| 31 void OnTimeDomainHasDelayedWork() override; | 31 void OnTimeDomainHasDelayedWork() override; |
| 32 | 32 |
| 33 // The purpose of this method is to make sure thottling doesn't conflict with | 33 // The purpose of this method is to make sure throttling doesn't conflict with |
| 34 // enabling/disabling the queue for policy reasons. | 34 // enabling/disabling the queue for policy reasons. |
| 35 // If |task_queue| is throttled then the ThrottlingHelper remembers the | 35 // If |task_queue| is throttled then the ThrottlingHelper remembers the |
| 36 // |enabled| setting. In addition if |enabled| is false then the queue is | 36 // |enabled| setting. In addition if |enabled| is false then the queue is |
| 37 // immediatly disabled. Otherwise if |task_queue| not throttled then | 37 // immediatly disabled. Otherwise if |task_queue| not throttled then |
| 38 // TaskQueue::SetEnabled(enabled) is called. | 38 // TaskQueue::SetEnabled(enabled) is called. |
| 39 void SetQueueEnabled(TaskQueue* task_queue, bool enabled); | 39 void SetQueueEnabled(TaskQueue* task_queue, bool enabled); |
| 40 | 40 |
| 41 // Increments the throttled refcount and causes |task_queue| to be throttled | 41 // Increments the throttled refcount and causes |task_queue| to be throttled |
| 42 // if its not already throttled. | 42 // if its not already throttled. |
| 43 void IncreaseThrottleRefCount(TaskQueue* task_queue); | 43 void IncreaseThrottleRefCount(TaskQueue* task_queue); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 base::TimeTicks pending_pump_throttled_tasks_runtime_; | 90 base::TimeTicks pending_pump_throttled_tasks_runtime_; |
| 91 | 91 |
| 92 base::WeakPtrFactory<ThrottlingHelper> weak_factory_; | 92 base::WeakPtrFactory<ThrottlingHelper> weak_factory_; |
| 93 | 93 |
| 94 DISALLOW_COPY_AND_ASSIGN(ThrottlingHelper); | 94 DISALLOW_COPY_AND_ASSIGN(ThrottlingHelper); |
| 95 }; | 95 }; |
| 96 | 96 |
| 97 } // namespace scheduler | 97 } // namespace scheduler |
| 98 | 98 |
| 99 #endif // COMPONENTS_SCHEDULER_RENDERER_THROTTLING_HELPER_H_ | 99 #endif // COMPONENTS_SCHEDULER_RENDERER_THROTTLING_HELPER_H_ |
| OLD | NEW |