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

[TaskScheduler]: Migrate off of AssertBlockingAllowedDeprecated in /chrome/chrome_cleaner

base::AssertBlockingAllowedDeprecated is deprecated in favor of
ScopedBlockingCall, which serves as a precise annotation of
the scope that may/will block.

Please make sure of the following:
  - ScopedBlockingCall is instantiated in a scope with minimal CPU usage.
    If this is not the case, ScopedBlockingCall should be instantiated
    closer to the blocking call. See scoped_blocking_call.h for more
    info. Please let me know when/where the blocking call happens if this needs
    to be changed.
  - Parameter |blocking_type| matches expectation:
      MAY_BLOCK: The call might block (e.g. file I/O that might hit in memory cache).
      WILL_BLOCK: The call will definitely block (e.g. cache already checked and now pinging
        server synchronously).
    See BlockingType for more info. While I assumed MAY_BLOCK by default, that might
    not be the best fit if we know that this callsite is guaranteed to block.
  - The ScopedBlockingCall's scope covers the entirety of the blocking operation
    previously asserted against by the AssertBlockingAllowed().
  - Calls to blocking //base APIs don't need to be annotated
    with ScopedBlockingCall. All blocking //base APIs (e.g. base::ReadFileToString, base::File::Read,
    base::SysInfo::AmountOfFreeDiskSpace, base::WaitableEvent::Wait, etc.) have their
    own internal annotations.

Refer to the top-level CL if necessary :
https://chromium-review.googlesource.com/c/chromium/src/+/1338391

Please CQ if LGTY!

This CL was uploaded by git cl split.

R=csharp@chromium.org

Bug: 903957
Change-Id: I5ff84cb3c4169e19e04d59e682916eb6632a848a
Reviewed-on: https://chromium-review.googlesource.com/c/1338127Reviewed-by: default avatarproberge <proberge@chromium.org>
Commit-Queue: proberge <proberge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#609706}
parent 4d028f12
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#include "base/strings/string_split.h" #include "base/strings/string_split.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "base/synchronization/waitable_event.h" #include "base/synchronization/waitable_event.h"
#include "base/threading/thread_restrictions.h" #include "base/threading/scoped_blocking_call.h"
#include "base/time/time.h" #include "base/time/time.h"
#include "base/values.h" #include "base/values.h"
#include "base/win/registry.h" #include "base/win/registry.h"
...@@ -698,9 +698,8 @@ void ReportInstalledExtensions(JsonParserAPI* json_parser) { ...@@ -698,9 +698,8 @@ void ReportInstalledExtensions(JsonParserAPI* json_parser) {
DCHECK(json_parser); DCHECK(json_parser);
// TODO(proberge): Temporarily allowing syncing to avoid crashes in debug // TODO(proberge): Temporarily allowing syncing to avoid crashes in debug
// mode. This isn't catastrophic since the cleanup tool doesn't have a UI and // mode. This isn't catastrophic since the cleanup tool doesn't have a UI and
// the system report is collected at the end of the process. We also assert // the system report is collected at the end of the process.
// blocking is allowed here since it will block the thread. base::ScopedBlockingCall scoped_blocking_call(base::BlockingType::MAY_BLOCK);
base::AssertBlockingAllowedDeprecated();
base::ScopedAllowBaseSyncPrimitivesForTesting allow_sync; base::ScopedAllowBaseSyncPrimitivesForTesting allow_sync;
ReportForcelistExtensions(); ReportForcelistExtensions();
......
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