| Index: third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h
|
| diff --git a/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h b/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h
|
| index 79503356b851cf354ffc12f40d93ef4b862e6fac..06907525f1aee3dfd8fdffafbfc42566f5705734 100644
|
| --- a/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h
|
| +++ b/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h
|
| @@ -279,6 +279,26 @@ class BLINK_PLATFORM_EXPORT TaskQueueImpl final : public TaskQueue {
|
| base::trace_event::BlameContext* blame_context; // Not owned.
|
| EnqueueOrder current_fence;
|
| base::TimeTicks scheduled_time_domain_wakeup;
|
| +
|
| + // Number of times any thread lock was acquired from main thread to
|
| + // allow any thread lock be reentrable from main thread.
|
| + mutable size_t any_thread_lock_acquired_count;
|
| + };
|
| +
|
| + // Helper class to make any_thread_lock reentrable from main thread.
|
| + // When |acquired_count| pointer is non-null, class uses is to
|
| + // allow for reentrability. When |acquired_count| is nullptr,
|
| + // this helper class behaves as a normal base::AutoLock.
|
| + class AnyThreadAutoLock {
|
| + public:
|
| + AnyThreadAutoLock(base::Lock& lock, size_t* acquired_count);
|
| + AnyThreadAutoLock(AnyThreadAutoLock&& auto_lock) = default;
|
| + ~AnyThreadAutoLock();
|
| +
|
| + private:
|
| + base::Lock& lock_;
|
| + size_t* acquired_count_;
|
| + DISALLOW_COPY_AND_ASSIGN(AnyThreadAutoLock);
|
| };
|
|
|
| ~TaskQueueImpl() override;
|
| @@ -330,6 +350,8 @@ class BLINK_PLATFORM_EXPORT TaskQueueImpl final : public TaskQueue {
|
| void OnQueueEnabledVoteChanged(bool enabled);
|
| void EnableOrDisableWithSelector(bool enable);
|
|
|
| + AnyThreadAutoLock AcquireAnyThreadLock() const;
|
| +
|
| const base::PlatformThreadId thread_id_;
|
|
|
| mutable base::Lock any_thread_lock_;
|
|
|