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

Unified Diff: third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc

Issue 2708963002: Fix potential DCHECK in TaskQueueThrottler::IncreaseThrottleRefCount (Closed)
Patch Set: Addressing review comments. Created 3 years, 10 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/renderer/task_queue_throttler.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_impl.cc
diff --git a/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc b/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc
index fee7f311ab1eb2885fe4cf5c7f51be0844a82e76..742f845ba65bda18adc3e1ffe093d88567620901 100644
--- a/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc
+++ b/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc
@@ -803,6 +803,17 @@ void TaskQueueImpl::EnableOrDisableWithSelector(bool enable) {
return;
if (enable) {
+ // Check if there's any immediate work on either queue.
+ bool immediate_queues_empty =
+ main_thread_only().immediate_work_queue->Empty();
+ if (immediate_queues_empty) {
+ base::AutoLock lock(any_thread_lock_);
+ immediate_queues_empty = any_thread().immediate_incoming_queue.empty();
+ }
+ // Avoid holding the lock while we fire the notification.
+ if (!immediate_queues_empty)
+ main_thread_only().time_domain->OnQueueHasImmediateWork(this);
+
if (!main_thread_only().delayed_incoming_queue.empty()) {
main_thread_only().time_domain->ScheduleDelayedWork(
this,
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698