| 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" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 | 78 |
| 79 // Set the flag. May only be called if |write_lock| is held. | 79 // Set the flag. May only be called if |write_lock| is held. |
| 80 void SetLocked(bool value); | 80 void SetLocked(bool value); |
| 81 | 81 |
| 82 // Returns true iff the flag was set to true. | 82 // Returns true iff the flag was set to true. |
| 83 bool IsSet() const; | 83 bool IsSet() const; |
| 84 | 84 |
| 85 private: | 85 private: |
| 86 base::subtle::Atomic32 flag_; | 86 base::subtle::Atomic32 flag_; |
| 87 base::Lock* write_lock_; // Not owned. | 87 base::Lock* write_lock_; // Not owned. |
| 88 base::ThreadChecker thread_checker_; | |
| 89 | 88 |
| 90 DISALLOW_COPY_AND_ASSIGN(PollableNeedsUpdateFlag); | 89 DISALLOW_COPY_AND_ASSIGN(PollableNeedsUpdateFlag); |
| 91 }; | 90 }; |
| 92 | 91 |
| 93 // Returns the serialized scheduler state for tracing. | 92 // Returns the serialized scheduler state for tracing. |
| 94 scoped_refptr<base::debug::ConvertableToTraceFormat> AsValueLocked( | 93 scoped_refptr<base::debug::ConvertableToTraceFormat> AsValueLocked( |
| 95 base::TimeTicks optional_now) const; | 94 base::TimeTicks optional_now) const; |
| 96 static const char* TaskQueueIdToString(QueueId queue_id); | 95 static const char* TaskQueueIdToString(QueueId queue_id); |
| 97 static const char* PolicyToString(Policy policy); | 96 static const char* PolicyToString(Policy policy); |
| 98 | 97 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 | 150 |
| 152 base::WeakPtr<RendererSchedulerImpl> weak_renderer_scheduler_ptr_; | 151 base::WeakPtr<RendererSchedulerImpl> weak_renderer_scheduler_ptr_; |
| 153 base::WeakPtrFactory<RendererSchedulerImpl> weak_factory_; | 152 base::WeakPtrFactory<RendererSchedulerImpl> weak_factory_; |
| 154 | 153 |
| 155 DISALLOW_COPY_AND_ASSIGN(RendererSchedulerImpl); | 154 DISALLOW_COPY_AND_ASSIGN(RendererSchedulerImpl); |
| 156 }; | 155 }; |
| 157 | 156 |
| 158 } // namespace content | 157 } // namespace content |
| 159 | 158 |
| 160 #endif // CONTENT_RENDERER_SCHEDULER_RENDERER_SCHEDULER_IMPL_H_ | 159 #endif // CONTENT_RENDERER_SCHEDULER_RENDERER_SCHEDULER_IMPL_H_ |
| OLD | NEW |