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

[TaskScheduler]: Migrate off of ScopedAllowWait in /net

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=morlovich@chromium.org

Bug: 766678
Change-Id: Ibbaf0d854d2c8fb08b515e3fe8a3c7614630ab62
Reviewed-on: https://chromium-review.googlesource.com/c/1325203Reviewed-by: default avatarMaks Orlovich <morlovich@chromium.org>
Commit-Queue: Maks Orlovich <morlovich@chromium.org>
Cr-Commit-Position: refs/heads/master@{#606524}
parent 13383fc8
......@@ -273,7 +273,7 @@ bool AddressTrackerLinux::IsInterfaceIgnored(int interface_index) const {
NetworkChangeNotifier::ConnectionType
AddressTrackerLinux::GetCurrentConnectionType() {
// http://crbug.com/125097
base::ThreadRestrictions::ScopedAllowWait allow_wait;
base::ScopedAllowBaseSyncPrimitivesOutsideBlockingScope allow_wait;
AddressTrackerAutoLock lock(*this, connection_type_lock_);
// Make sure the initial connection type is set before returning.
threads_waiting_for_connection_type_initialization_++;
......
......@@ -92,7 +92,8 @@ NetworkChangeNotifierMac::NetworkChangeCalculatorParamsMac() {
NetworkChangeNotifier::ConnectionType
NetworkChangeNotifierMac::GetCurrentConnectionType() const {
base::ThreadRestrictions::ScopedAllowWait allow_wait;
// https://crbug.com/125097
base::ScopedAllowBaseSyncPrimitivesOutsideBlockingScope allow_wait;
base::AutoLock lock(connection_type_lock_);
// Make sure the initial connection type is set before returning.
while (!connection_type_initialized_) {
......
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