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

[TaskScheduler]: Migrate off of ScopedAllowWait in /chromeos/dbus

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

Bug: 766678
Change-Id: I931476842857ed391d7148febbcac1c811a9ead1
Reviewed-on: https://chromium-review.googlesource.com/c/1324398
Commit-Queue: Gabriel Charette <gab@chromium.org>
Reviewed-by: default avatarGabriel Charette <gab@chromium.org>
Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#607029}
parent 7a9e221b
...@@ -367,7 +367,6 @@ class BASE_EXPORT ScopedAllowBaseSyncPrimitives { ...@@ -367,7 +367,6 @@ class BASE_EXPORT ScopedAllowBaseSyncPrimitives {
// Usage that should be fixed: // Usage that should be fixed:
friend class ::NativeBackendKWallet; // http://crbug.com/125331 friend class ::NativeBackendKWallet; // http://crbug.com/125331
friend class ::chromeos::BlockingMethodCaller; // http://crbug.com/125360
friend class ::chromeos::system:: friend class ::chromeos::system::
StatisticsProviderImpl; // http://crbug.com/125385 StatisticsProviderImpl; // http://crbug.com/125385
friend class content::TextInputClientMac; // http://crbug.com/121917 friend class content::TextInputClientMac; // http://crbug.com/121917
...@@ -406,6 +405,7 @@ class BASE_EXPORT ScopedAllowBaseSyncPrimitivesOutsideBlockingScope { ...@@ -406,6 +405,7 @@ class BASE_EXPORT ScopedAllowBaseSyncPrimitivesOutsideBlockingScope {
friend class viz::HostGpuMemoryBufferManager; friend class viz::HostGpuMemoryBufferManager;
// Usage that should be fixed: // Usage that should be fixed:
friend class ::chromeos::BlockingMethodCaller; // http://crbug.com/125360
friend class cc::CompletionEvent; // http://crbug.com/902653 friend class cc::CompletionEvent; // http://crbug.com/902653
friend class cc::SingleThreadTaskGraphRunner; // http://crbug.com/902823 friend class cc::SingleThreadTaskGraphRunner; // http://crbug.com/902823
friend class content:: friend class content::
......
...@@ -63,7 +63,7 @@ BlockingMethodCaller::CallMethodAndBlockWithError( ...@@ -63,7 +63,7 @@ BlockingMethodCaller::CallMethodAndBlockWithError(
base::Owned(signaler), base::Unretained(proxy_), base::Owned(signaler), base::Unretained(proxy_),
method_call, error_out)); method_call, error_out));
// http://crbug.com/125360 // http://crbug.com/125360
base::ThreadRestrictions::ScopedAllowWait allow_wait; base::ScopedAllowBaseSyncPrimitivesOutsideBlockingScope allow_wait;
on_blocking_method_call_.Wait(); on_blocking_method_call_.Wait();
return response; return response;
} }
......
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