DescriptionRevert of [Sync] Refactor ModelSafeWorker::DoWorkAndWaitUntilDone() to avoid code duplication. (patchset #11 id:200001 of https://codereview.chromium.org/2782573002/ )
Reason for revert:
Causing build failure. More info at https://bugs.chromium.org/p/chromium/issues/detail?id=711466.
Original issue's description:
> [Sync] Refactor ModelSafeWorker::DoWorkAndWaitUntilDone() to avoid code duplication.
>
> Before this CL, logic to wait for a WorkCallback to run or be
> abandoned was duplicated in multiple
> ModelSafeWorker::DoWorkAndWaitUntilDoneImpl() implementations.
>
> With this CL, ModelSafeWorker::DoWorkAndWaitUntilDoneImpl() is
> replaced with ModelSafeWorker::ScheduleWork(). Implementations
> are merely responsible for scheduling the callback that they
> receive; they don't have to wait for it to run or be abandoned.
>
> The logic to wait for the callback to run or be abandoned is moved
> into ModelSafeWorker::DoWorkAndWaitUntilDone().
> ModelSafeWorker::DoWorkAndWaitUntilDone() calls
> ModelSafeWorker::ScheduleWork(). Then, it waits until either the
> callback that it passed to ModelSafeWorker::ScheduleWork() is deleted
> (may or may not have run) or ModelSafeWorker::RequestStop() is called
> before the callback has started to run. Additionnaly, calling
> ModelSafeWorker::RequestStop() transforms into no-op further
> invocations of callbacks passed to ModelSafeWorker::ScheduleWork().
>
> Unblocking ModelSafeWorker::DoWorkAndWaitUntilDone() when
> ModelSafeWorker::RequestStop() is called is important to
> prevent deadlocks in workers that schedule work on the UI
> thread. Indeed, in Chrome, no tasks are scheduled on the UI
> thread after ModelSafeWorker::RequestStop() is called and
> pending UI tasks are not scheduled until after the sync thread
> is joined.
>
> BUG=663600
>
> Review-Url: https://codereview.chromium.org/2782573002
> Cr-Commit-Position: refs/heads/master@{#463413}
> Committed: https://chromium.googlesource.com/chromium/src/+/316c08f3692150ac1c416c67391768622cc6a77f
TBR=brettw@chromium.org,skym@chromium.org,dvadym@chromium.org,fdoray@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=663600
Review-Url: https://codereview.chromium.org/2820623002
Cr-Commit-Position: refs/heads/master@{#464628}
Committed: https://chromium.googlesource.com/chromium/src/+/bb76b686d4b7ed1fd7413a1f4ee17de4452d1ac0
Patch Set 1 #Messages
Total messages: 6 (3 generated)
|