New issue
Advanced search Search tips

Issue 646905 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 665062
Owner:
Closed: Dec 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Rename TaskRunner::RunsTasksOnCurrentThread()

Project Member Reported by fdoray@chromium.org, Sep 14 2016

Issue description

The current name and description of TaskRunner::RunsTasksOnCurrentThread() doesn't match the behavior of SequencedWorkerPoolSequencedTaskRunner::RunsTasksOnCurrentThread().

task_runner.h:

  // Returns true if the current thread is a thread on which a task
  // may be run, and false if no task will be run on the current
  // thread.
  //
  // It is valid for an implementation to always return true, or in
  // general to use 'true' as a default value.
  virtual bool RunsTasksOnCurrentThread() const = 0;

sequenced_worker_pool.cc:

bool SequencedWorkerPoolSequencedTaskRunner::RunsTasksOnCurrentThread() const {
  return pool_->IsRunningSequenceOnCurrentThread(token_);
}

Note: The above method returns true iff the current task is sequenced with tasks posted to the SequencedWorkerPoolSequencedTaskRunner on which it is called.

We should update the name and description of TaskRunner::RunsTasksOnCurrentThread() to match the behavior of all its impls.
 

Comment 1 by michaeln@google.com, Sep 14 2016

+1 retaining the functionality of SWP IsRunningSequenceOnCurrentThread(token_) behavior thru the abstract [Sequenced]TaskRunner interface. I think that might be prerequisite to completing the task_scheduler migration?

Project Member

Comment 2 by bugdroid1@chromium.org, Sep 15 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/04afc10b90ca1b485a3afb9404245c2fe1b7f286

commit 04afc10b90ca1b485a3afb9404245c2fe1b7f286
Author: fdoray <fdoray@chromium.org>
Date: Thu Sep 15 13:08:17 2016

TaskScheduler: Match behavior of SequencedWorkerPool in RunsTasksOnCurrentThread().

The RunsTasksOnCurrentThread() method of a SequencedTaskRunner returned
by a SequencedWorkerPool returns true iff the current task is part of
the sequence associated with the SequencedTaskRunner.

This CL changes SchedulerSequencedTaskRunner to match the behavior of
SequencedWorkerPool.

BUG= 553459 , 646905 

Review-Url: https://codereview.chromium.org/2340793002
Cr-Commit-Position: refs/heads/master@{#418850}

[modify] https://crrev.com/04afc10b90ca1b485a3afb9404245c2fe1b7f286/base/task_scheduler/scheduler_worker_pool_impl.cc
[modify] https://crrev.com/04afc10b90ca1b485a3afb9404245c2fe1b7f286/base/task_scheduler/scheduler_worker_pool_impl_unittest.cc

Comment 3 by gab@chromium.org, Nov 7 2016

Components: Internals>TaskScheduler

Comment 4 by fdoray@chromium.org, Dec 19 2016

Mergedinto: 665062
Status: Duplicate (was: Assigned)

Sign in to add a comment