| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 BASE_MESSAGE_LOOP_MESSAGE_LOOP_TASK_RUNNER_H_ | 5 #ifndef BASE_MESSAGE_LOOP_MESSAGE_LOOP_TASK_RUNNER_H_ |
| 6 #define BASE_MESSAGE_LOOP_MESSAGE_LOOP_TASK_RUNNER_H_ | 6 #define BASE_MESSAGE_LOOP_MESSAGE_LOOP_TASK_RUNNER_H_ |
| 7 | 7 |
| 8 #include "base/base_export.h" | 8 #include "base/base_export.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 // Initialize this message loop task runner on the current thread. | 30 // Initialize this message loop task runner on the current thread. |
| 31 void BindToCurrentThread(); | 31 void BindToCurrentThread(); |
| 32 | 32 |
| 33 // SingleThreadTaskRunner implementation | 33 // SingleThreadTaskRunner implementation |
| 34 bool PostDelayedTask(const tracked_objects::Location& from_here, | 34 bool PostDelayedTask(const tracked_objects::Location& from_here, |
| 35 OnceClosure task, | 35 OnceClosure task, |
| 36 base::TimeDelta delay) override; | 36 base::TimeDelta delay) override; |
| 37 bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, | 37 bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, |
| 38 OnceClosure task, | 38 OnceClosure task, |
| 39 base::TimeDelta delay) override; | 39 base::TimeDelta delay) override; |
| 40 bool RunsTasksOnCurrentThread() const override; | 40 bool RunsTasksInCurrentSequence() const override; |
| 41 | 41 |
| 42 private: | 42 private: |
| 43 friend class RefCountedThreadSafe<MessageLoopTaskRunner>; | 43 friend class RefCountedThreadSafe<MessageLoopTaskRunner>; |
| 44 ~MessageLoopTaskRunner() override; | 44 ~MessageLoopTaskRunner() override; |
| 45 | 45 |
| 46 // The incoming queue receiving all posted tasks. | 46 // The incoming queue receiving all posted tasks. |
| 47 scoped_refptr<IncomingTaskQueue> incoming_queue_; | 47 scoped_refptr<IncomingTaskQueue> incoming_queue_; |
| 48 | 48 |
| 49 // ID of the thread |this| was created on. Could be accessed on multiple | 49 // ID of the thread |this| was created on. Could be accessed on multiple |
| 50 // threads, protected by |valid_thread_id_lock_|. | 50 // threads, protected by |valid_thread_id_lock_|. |
| 51 PlatformThreadId valid_thread_id_; | 51 PlatformThreadId valid_thread_id_; |
| 52 mutable Lock valid_thread_id_lock_; | 52 mutable Lock valid_thread_id_lock_; |
| 53 | 53 |
| 54 DISALLOW_COPY_AND_ASSIGN(MessageLoopTaskRunner); | 54 DISALLOW_COPY_AND_ASSIGN(MessageLoopTaskRunner); |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 } // namespace internal | 57 } // namespace internal |
| 58 } // namespace base | 58 } // namespace base |
| 59 | 59 |
| 60 #endif // BASE_MESSAGE_LOOP_MESSAGE_LOOP_TASK_RUNNER_H_ | 60 #endif // BASE_MESSAGE_LOOP_MESSAGE_LOOP_TASK_RUNNER_H_ |
| OLD | NEW |