Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Unified Diff: third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.h

Issue 2649813003: Adds TaskQueueManager::AnyThread (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.h
diff --git a/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.h b/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.h
index 6b4305ea49243ada10b507e7e5e4814f9983a4b9..6be58654fb5b9a87041a2b3c1a89d1b667699b05 100644
--- a/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.h
+++ b/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.h
@@ -246,9 +246,25 @@ class BLINK_PLATFORM_EXPORT TaskQueueManager
// the main thread and other threads.
std::set<base::TimeTicks> main_thread_pending_wakeups_;
- // Protects |other_thread_pending_wakeup_|.
- mutable base::Lock other_thread_lock_;
- bool other_thread_pending_wakeup_;
+ struct AnyThread {
+ AnyThread();
+
+ bool other_thread_pending_wakeup;
+ };
+
+ // TODO(alexclarke): Add a MainThreadOnly struct too.
+
+ mutable base::Lock any_thread_lock_;
+ AnyThread any_thread_;
+
+ struct AnyThread& any_thread() {
+ any_thread_lock_.AssertAcquired();
+ return any_thread_;
+ }
+ const struct AnyThread& any_thread() const {
+ any_thread_lock_.AssertAcquired();
+ return any_thread_;
+ }
bool record_task_delay_histograms_;
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698