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

[TaskScheduler]: Migrate off of AssertBlockingAllowedDeprecated in /ui

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

Bug: 903957
Change-Id: I86f204337a4137c79f85eb73e5601b9a02fe578a
Reviewed-on: https://chromium-review.googlesource.com/c/1338489Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#608824}
parent b63ceeb6
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include "base/native_library.h" #include "base/native_library.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
#include "base/threading/thread_restrictions.h" #include "base/threading/scoped_blocking_call.h"
#include "base/win/win_util.h" #include "base/win/win_util.h"
#include "ui/base/ui_base_switches.h" #include "ui/base/ui_base_switches.h"
...@@ -42,7 +42,7 @@ bool InvokeShellExecute(const base::string16 path, ...@@ -42,7 +42,7 @@ bool InvokeShellExecute(const base::string16 path,
const base::string16 args, const base::string16 args,
const base::string16 verb, const base::string16 verb,
DWORD mask) { DWORD mask) {
base::AssertBlockingAllowedDeprecated(); base::ScopedBlockingCall scoped_blocking_call(base::BlockingType::WILL_BLOCK);
SHELLEXECUTEINFO sei = {sizeof(sei)}; SHELLEXECUTEINFO sei = {sizeof(sei)};
sei.fMask = mask; sei.fMask = mask;
sei.nShow = SW_SHOWNORMAL; sei.nShow = SW_SHOWNORMAL;
......
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