OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_TASK_SCHEDULER_TASK_TRACKER_POSIX_H_ | 5 #ifndef BASE_TASK_SCHEDULER_TASK_TRACKER_POSIX_H_ |
6 #define BASE_TASK_SCHEDULER_TASK_TRACKER_POSIX_H_ | 6 #define BASE_TASK_SCHEDULER_TASK_TRACKER_POSIX_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/base_export.h" | 10 #include "base/base_export.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 // TODO(robliao): http://crbug.com/698140. This addresses service thread tasks | 43 // TODO(robliao): http://crbug.com/698140. This addresses service thread tasks |
44 // that could run after the task scheduler has shut down. Anything from the | 44 // that could run after the task scheduler has shut down. Anything from the |
45 // service thread is exempted from the task scheduler shutdown DCHECKs. | 45 // service thread is exempted from the task scheduler shutdown DCHECKs. |
46 void set_service_thread_handle( | 46 void set_service_thread_handle( |
47 const PlatformThreadHandle& service_thread_handle) { | 47 const PlatformThreadHandle& service_thread_handle) { |
48 DCHECK(!service_thread_handle.is_null()); | 48 DCHECK(!service_thread_handle.is_null()); |
49 service_thread_handle_ = service_thread_handle; | 49 service_thread_handle_ = service_thread_handle; |
50 } | 50 } |
51 #endif | 51 #endif |
52 | 52 |
53 protected: | 53 private: |
54 // TaskTracker: | 54 // TaskTracker: |
55 void PerformRunTask(std::unique_ptr<Task> task, | 55 void PerformRunTask(std::unique_ptr<Task> task, |
56 const SequenceToken& sequence_token) override; | 56 const SequenceToken& sequence_token) override; |
57 | 57 |
58 private: | |
59 #if DCHECK_IS_ON() | 58 #if DCHECK_IS_ON() |
60 bool IsPostingBlockShutdownTaskAfterShutdownAllowed() override; | 59 bool IsPostingBlockShutdownTaskAfterShutdownAllowed() override; |
61 #endif | 60 #endif |
62 | 61 |
63 MessageLoopForIO* watch_file_descriptor_message_loop_ = nullptr; | 62 MessageLoopForIO* watch_file_descriptor_message_loop_ = nullptr; |
64 | 63 |
65 #if DCHECK_IS_ON() | 64 #if DCHECK_IS_ON() |
66 PlatformThreadHandle service_thread_handle_; | 65 PlatformThreadHandle service_thread_handle_; |
67 #endif | 66 #endif |
68 | 67 |
69 DISALLOW_COPY_AND_ASSIGN(TaskTrackerPosix); | 68 DISALLOW_COPY_AND_ASSIGN(TaskTrackerPosix); |
70 }; | 69 }; |
71 | 70 |
72 } // namespace internal | 71 } // namespace internal |
73 } // namespace base | 72 } // namespace base |
74 | 73 |
75 #endif // BASE_TASK_SCHEDULER_TASK_TRACKER_POSIX_H_ | 74 #endif // BASE_TASK_SCHEDULER_TASK_TRACKER_POSIX_H_ |
OLD | NEW |