Skip to content
  • fdoray's avatar
    TaskScheduler: Change Sequence::PeekTask to Sequence::TakeTask. · 0c97aa3c
    fdoray authored
    Sequence::TakeTask() transfers ownership of the Task in the front slot of
    the Sequence to the caller. This makes the front slot empty. The empty
    front slot can be removed with Sequence::RemoveFrontSlot().
    
    Benefits of transfering ownership of a Task to code that runs it:
    - The code that runs (and owns) the Task can modify it. This is
      important if we want to use OnceClosure in TaskScheduler.
    - It is now clear that a single thread has a pointer to a given
      Task at a time (before, multiple threads calling PeekTask on
      the same Sequence could theoretically get pointers to the same
      Task).
    
    BUG=553459
    
    Review-Url: https://codereview.chromium.org/2399213005
    Cr-Commit-Position: refs/heads/master@{#424719}
    0c97aa3c