Commit c6a3bafd authored by Etienne Pierre-Doray's avatar Etienne Pierre-Doray Committed by Commit Bot

[TaskScheudler]: Migrate off of ScopedAllowWait in /chrome

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

It should have been replaced by :
 * base::ScopedAllowBaseSyncPrimitivesForTesting in test files.
 * base::ScopedAllowSyncPrimitives in non-test files
 * base::ScopedAllowSyncPrimitivesOutsideBlockingScope 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=thakis@chromium.org

Bug: 766678
Change-Id: Ifef9e8ac9c9893f4e11e20dc8221578971904b6f
Reviewed-on: https://chromium-review.googlesource.com/c/1325194
Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#615683}
parent 91782b91
......@@ -340,7 +340,6 @@ class BASE_EXPORT ScopedAllowBaseSyncPrimitives {
ScopedAllowBaseSyncPrimitivesWithBlockingDisallowed);
// Allowed usage:
friend class ::BrowserProcessImpl;
friend class SimpleThread;
friend class android_webview::AwFormDatabaseService;
friend class android_webview::CookieManager;
......@@ -390,6 +389,7 @@ class BASE_EXPORT ScopedAllowBaseSyncPrimitivesOutsideBlockingScope {
ScopedAllowBaseSyncPrimitivesOutsideBlockingScopeResetsState);
// Allowed usage:
friend class ::BrowserProcessImpl; // http://crbug.com/125207
friend class ::KeyStorageLinux;
friend class Thread;
friend class android::JavaHandlerThread;
......
......@@ -599,8 +599,10 @@ void BrowserProcessImpl::EndSession() {
#endif
}
// This wait is legitimate and necessary on Windows, since the process will
// be terminated soon.
// http://crbug.com/125207
base::ThreadRestrictions::ScopedAllowWait allow_wait;
base::ScopedAllowBaseSyncPrimitivesOutsideBlockingScope allow_wait;
// We must write that the profile and metrics service shutdown cleanly,
// otherwise on startup we'll think we crashed. So we block until done and
......
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