Commit 940082f0 authored by fdoray's avatar fdoray Committed by Commit bot

Remove SequencedWorkerPool::PostDelayedWorkerTask().

There are no more callers of this method.

BUG=667892

Review-Url: https://codereview.chromium.org/2882523002
Cr-Commit-Position: refs/heads/master@{#472194}
parent 68d14c04
...@@ -173,7 +173,7 @@ bool SequencedWorkerPoolTaskRunner::PostDelayedTask( ...@@ -173,7 +173,7 @@ bool SequencedWorkerPoolTaskRunner::PostDelayedTask(
return pool_->PostWorkerTaskWithShutdownBehavior(from_here, std::move(task), return pool_->PostWorkerTaskWithShutdownBehavior(from_here, std::move(task),
shutdown_behavior_); shutdown_behavior_);
} }
return pool_->PostDelayedWorkerTask(from_here, std::move(task), delay); return pool_->PostDelayedTask(from_here, std::move(task), delay);
} }
bool SequencedWorkerPoolTaskRunner::RunsTasksInCurrentSequence() const { bool SequencedWorkerPoolTaskRunner::RunsTasksInCurrentSequence() const {
...@@ -1552,16 +1552,6 @@ bool SequencedWorkerPool::PostWorkerTask( ...@@ -1552,16 +1552,6 @@ bool SequencedWorkerPool::PostWorkerTask(
std::move(task), TimeDelta()); std::move(task), TimeDelta());
} }
bool SequencedWorkerPool::PostDelayedWorkerTask(
const tracked_objects::Location& from_here,
OnceClosure task,
TimeDelta delay) {
WorkerShutdown shutdown_behavior =
delay.is_zero() ? BLOCK_SHUTDOWN : SKIP_ON_SHUTDOWN;
return inner_->PostTask(NULL, SequenceToken(), shutdown_behavior, from_here,
std::move(task), delay);
}
bool SequencedWorkerPool::PostWorkerTaskWithShutdownBehavior( bool SequencedWorkerPool::PostWorkerTaskWithShutdownBehavior(
const tracked_objects::Location& from_here, const tracked_objects::Location& from_here,
OnceClosure task, OnceClosure task,
...@@ -1611,7 +1601,10 @@ bool SequencedWorkerPool::PostDelayedTask( ...@@ -1611,7 +1601,10 @@ bool SequencedWorkerPool::PostDelayedTask(
const tracked_objects::Location& from_here, const tracked_objects::Location& from_here,
OnceClosure task, OnceClosure task,
TimeDelta delay) { TimeDelta delay) {
return PostDelayedWorkerTask(from_here, std::move(task), delay); WorkerShutdown shutdown_behavior =
delay.is_zero() ? BLOCK_SHUTDOWN : SKIP_ON_SHUTDOWN;
return inner_->PostTask(nullptr, SequenceToken(), shutdown_behavior,
from_here, std::move(task), delay);
} }
bool SequencedWorkerPool::RunsTasksInCurrentSequence() const { bool SequencedWorkerPool::RunsTasksInCurrentSequence() const {
......
...@@ -278,19 +278,6 @@ class BASE_EXPORT SequencedWorkerPool : public TaskRunner { ...@@ -278,19 +278,6 @@ class BASE_EXPORT SequencedWorkerPool : public TaskRunner {
bool PostWorkerTask(const tracked_objects::Location& from_here, bool PostWorkerTask(const tracked_objects::Location& from_here,
OnceClosure task); OnceClosure task);
// Same as PostWorkerTask but allows a delay to be specified (although doing
// so changes the shutdown behavior). The task will be run after the given
// delay has elapsed.
//
// If the delay is nonzero, the task won't be guaranteed to run to completion
// before shutdown (SKIP_ON_SHUTDOWN semantics) to avoid shutdown hangs.
// If the delay is zero, this behaves exactly like PostWorkerTask, i.e. the
// task will be guaranteed to run to completion before shutdown
// (BLOCK_SHUTDOWN semantics).
bool PostDelayedWorkerTask(const tracked_objects::Location& from_here,
OnceClosure task,
TimeDelta delay);
// Same as PostWorkerTask but allows specification of the shutdown behavior. // Same as PostWorkerTask but allows specification of the shutdown behavior.
bool PostWorkerTaskWithShutdownBehavior( bool PostWorkerTaskWithShutdownBehavior(
const tracked_objects::Location& from_here, const tracked_objects::Location& from_here,
......
...@@ -991,9 +991,9 @@ TEST_P(SequencedWorkerPoolTest, FlushForTesting) { ...@@ -991,9 +991,9 @@ TEST_P(SequencedWorkerPoolTest, FlushForTesting) {
// Queue up a bunch of work, including a long delayed task and // Queue up a bunch of work, including a long delayed task and
// a task that produces additional tasks as an artifact. // a task that produces additional tasks as an artifact.
pool()->PostDelayedWorkerTask( pool()->PostDelayedTask(FROM_HERE,
FROM_HERE, base::BindOnce(&TestTracker::FastTask, tracker(), 0), base::BindOnce(&TestTracker::FastTask, tracker(), 0),
TimeDelta::FromMinutes(5)); TimeDelta::FromMinutes(5));
pool()->PostWorkerTask(FROM_HERE, pool()->PostWorkerTask(FROM_HERE,
base::BindOnce(&TestTracker::SlowTask, tracker(), 0)); base::BindOnce(&TestTracker::SlowTask, tracker(), 0));
const size_t kNumFastTasks = 20; const size_t kNumFastTasks = 20;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment