Commit 22c3f92b authored by Etienne Pierre-doray's avatar Etienne Pierre-doray Committed by Commit Bot

[TaskScheduler]: Migrate off of ScopedAllowWait in /net/disk_cache

base::ThreadRestrictions::ScopedAllowWait is deprecated in favor of its more
explicit counterpart.

It should have been replaced by :
 * base::ScopedAllowBaseSyncPrimitivesForTesting in test files.
 * base::ScopedAllowBaseSyncPrimitives in non-test files
 * base::ScopedAllowBaseSyncPrimitivesOutsideBlockingScope when it's used on threads
   that don't allow blocking
The last one is strongly frowned upon but this CL aims to document existing
behavior rather than address it. Owners are encouraged to follow-up by fixing
unnecessary waits and more particularly unnecessary waits
outside-blocking-scope.

Note: The non-for-testing versions require friend'ing in thread_restrictions.h
but care was taken to add these friends ahead of git cl split (since it wasn't
possible to do a line-by-line associated CL split).
Refer to the top-level CL if necessary :
https://chromium-review.googlesource.com/c/chromium/src/+/1288533

Please CQ if LGTY!

This CL was uploaded by git cl split.

R=jkarlin@chromium.org

Bug: 766678
Change-Id: I51f5ca1c02138ff83229148f833f53bf1c0a1c8e
Reviewed-on: https://chromium-review.googlesource.com/c/1325208Reviewed-by: default avatarJosh Karlin <jkarlin@chromium.org>
Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
Cr-Commit-Position: refs/heads/master@{#607375}
parent fe5964c5
...@@ -221,7 +221,7 @@ BackendImpl::~BackendImpl() { ...@@ -221,7 +221,7 @@ BackendImpl::~BackendImpl() {
FROM_HERE, FROM_HERE,
base::BindOnce(&FinalCleanupCallback, base::Unretained(this))); base::BindOnce(&FinalCleanupCallback, base::Unretained(this)));
// http://crbug.com/74623 // http://crbug.com/74623
base::ThreadRestrictions::ScopedAllowWait allow_wait; base::ScopedAllowBaseSyncPrimitivesOutsideBlockingScope allow_wait;
done_.Wait(); done_.Wait();
} }
} }
......
...@@ -85,7 +85,7 @@ void InFlightIO::OnIOComplete(BackgroundIO* operation) { ...@@ -85,7 +85,7 @@ void InFlightIO::OnIOComplete(BackgroundIO* operation) {
void InFlightIO::InvokeCallback(BackgroundIO* operation, bool cancel_task) { void InFlightIO::InvokeCallback(BackgroundIO* operation, bool cancel_task) {
{ {
// http://crbug.com/74623 // http://crbug.com/74623
base::ThreadRestrictions::ScopedAllowWait allow_wait; base::ScopedAllowBaseSyncPrimitivesOutsideBlockingScope allow_wait;
operation->io_completed()->Wait(); operation->io_completed()->Wait();
} }
running_ = true; running_ = true;
......
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