worker: Move clean-up tasks from PrepareForShutdown to PerformShutdown

Clearing objects should be done atomically, and no other tasks
should have a chance to be run during it.
This CL moves tasks to clean up objects on a worker thread from
PrepareForShutdownOnWorkerThread to PerformShutdownOnWorkerThread,
because those two methods can be run separately.

Bug: 773605
Change-Id: Id263ad914a9eb9147b38f1557153eee9fa76cd34
Reviewed-on: https://chromium-review.googlesource.com/1126740
Commit-Queue: Hitoshi Yoshida <peria@chromium.org>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#572744}
1 file changed