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

[TaskScheduler]: Migrate off of ScopedAllowWait in /content/browser

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

Bug: 766678
Change-Id: Id041725a059110494a5805f98f3eba5b5bab6bff
Reviewed-on: https://chromium-review.googlesource.com/c/1324453Reviewed-by: default avatarBo <boliu@chromium.org>
Reviewed-by: default avatarGabriel Charette <gab@chromium.org>
Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
Cr-Commit-Position: refs/heads/master@{#607239}
parent b9a32610
...@@ -350,7 +350,6 @@ class BASE_EXPORT ScopedAllowBaseSyncPrimitives { ...@@ -350,7 +350,6 @@ class BASE_EXPORT ScopedAllowBaseSyncPrimitives {
friend class base::StackSamplingProfiler; friend class base::StackSamplingProfiler;
friend class content::BrowserMainLoop; friend class content::BrowserMainLoop;
friend class content::BrowserProcessSubThread; friend class content::BrowserProcessSubThread;
friend class content::ScopedAllowWaitForDebugURL;
friend class content::ServiceWorkerSubresourceLoader; friend class content::ServiceWorkerSubresourceLoader;
friend class content::SessionStorageDatabase; friend class content::SessionStorageDatabase;
friend class functions::ExecScriptScopedAllowBaseSyncPrimitives; friend class functions::ExecScriptScopedAllowBaseSyncPrimitives;
...@@ -398,6 +397,7 @@ class BASE_EXPORT ScopedAllowBaseSyncPrimitivesOutsideBlockingScope { ...@@ -398,6 +397,7 @@ class BASE_EXPORT ScopedAllowBaseSyncPrimitivesOutsideBlockingScope {
friend class ::KeyStorageLinux; friend class ::KeyStorageLinux;
friend class Thread; friend class Thread;
friend class base::MessageLoopImpl; friend class base::MessageLoopImpl;
friend class content::ScopedAllowWaitForDebugURL;
friend class content::SynchronousCompositor; friend class content::SynchronousCompositor;
friend class content::SynchronousCompositorHost; friend class content::SynchronousCompositorHost;
friend class content::SynchronousCompositorSyncCallBridge; friend class content::SynchronousCompositorSyncCallBridge;
......
...@@ -36,7 +36,7 @@ namespace content { ...@@ -36,7 +36,7 @@ namespace content {
class ScopedAllowWaitForDebugURL { class ScopedAllowWaitForDebugURL {
private: private:
base::ThreadRestrictions::ScopedAllowWait wait; base::ScopedAllowBaseSyncPrimitivesOutsideBlockingScope wait;
}; };
namespace { namespace {
......
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