Reland "[TaskScheduler]: Migrate off of ScopedAllowWait in /base/profiler/stack_sampling_profiler.cc"

This is a reland of 50b50793ee7891ab8ff9a4bab66c0c43391aa4ad

This CL changes ScopedAllowBaseSyncPrimitives to ScopedAllowBaseSyncPrimitivesOutsideBlockingScope
in StackSamplingProfiler.

Original change's description:
> [TaskScheduler]: Migrate off of ScopedAllowWait in /base/profiler/stack_sampling_profiler.cc
>
> 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=wittman@chromium.org
>
> Bug: 766678
> Change-Id: I2c45612b77a49ca5720da95093b0cdd8845b6f03
> Reviewed-on: https://chromium-review.googlesource.com/c/1325191
> Reviewed-by: Mike Wittman <wittman@chromium.org>
> Commit-Queue: Mike Wittman <wittman@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#606478}

Bug: 766678, 907177
Change-Id: I45b48e57040721e5ff3c2bdaac62237ed7ae429e
Reviewed-on: https://chromium-review.googlesource.com/c/1349633
Reviewed-by: Mike Wittman <wittman@chromium.org>
Reviewed-by: Fran├žois Doray <fdoray@chromium.org>
Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
Cr-Commit-Position: refs/heads/master@{#611687}
2 files changed