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

Side by Side Diff: base/task_scheduler/scheduler_worker_pool_impl.cc

Issue 2815573002: CHECK tasks posted by TaskRunner::PostTask (Closed)
Patch Set: +comment Created 3 years, 8 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 unified diff | Download patch
« no previous file with comments | « base/task_scheduler/delayed_task_manager.cc ('k') | base/task_scheduler/sequence.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "base/task_scheduler/scheduler_worker_pool_impl.h" 5 #include "base/task_scheduler/scheduler_worker_pool_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <utility> 10 #include <utility>
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 scoped_refptr<Sequence> sequence) { 340 scoped_refptr<Sequence> sequence) {
341 DCHECK(task); 341 DCHECK(task);
342 DCHECK(sequence); 342 DCHECK(sequence);
343 343
344 if (!task_tracker_->WillPostTask(task.get())) 344 if (!task_tracker_->WillPostTask(task.get()))
345 return false; 345 return false;
346 346
347 if (task->delayed_run_time.is_null()) { 347 if (task->delayed_run_time.is_null()) {
348 PostTaskWithSequenceNow(std::move(task), std::move(sequence)); 348 PostTaskWithSequenceNow(std::move(task), std::move(sequence));
349 } else { 349 } else {
350 DCHECK(task->task); 350 // Use CHECK instead of DCHECK to crash earlier. See http://crbug.com/711167
351 // for details.
352 CHECK(task->task);
351 delayed_task_manager_->AddDelayedTask( 353 delayed_task_manager_->AddDelayedTask(
352 std::move(task), 354 std::move(task),
353 Bind( 355 Bind(
354 [](scoped_refptr<Sequence> sequence, 356 [](scoped_refptr<Sequence> sequence,
355 SchedulerWorkerPool* worker_pool, std::unique_ptr<Task> task) { 357 SchedulerWorkerPool* worker_pool, std::unique_ptr<Task> task) {
356 worker_pool->PostTaskWithSequenceNow(std::move(task), 358 worker_pool->PostTaskWithSequenceNow(std::move(task),
357 std::move(sequence)); 359 std::move(sequence));
358 }, 360 },
359 std::move(sequence), Unretained(this))); 361 std::move(sequence), Unretained(this)));
360 } 362 }
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 AutoSchedulerLock auto_lock(idle_workers_stack_lock_); 618 AutoSchedulerLock auto_lock(idle_workers_stack_lock_);
617 idle_workers_stack_.Remove(worker); 619 idle_workers_stack_.Remove(worker);
618 } 620 }
619 621
620 bool SchedulerWorkerPoolImpl::CanWorkerDetachForTesting() { 622 bool SchedulerWorkerPoolImpl::CanWorkerDetachForTesting() {
621 return !worker_detachment_disallowed_.IsSet(); 623 return !worker_detachment_disallowed_.IsSet();
622 } 624 }
623 625
624 } // namespace internal 626 } // namespace internal
625 } // namespace base 627 } // namespace base
OLDNEW
« no previous file with comments | « base/task_scheduler/delayed_task_manager.cc ('k') | base/task_scheduler/sequence.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698