• Etienne Pierre-doray's avatar
    [TaskScheduler]: Use AssertLongCPUWorkAllowed to better match intent in chrome/browser/android · 4f2e41be
    Etienne Pierre-doray authored
    Instead of ScopedBlockingCall or AssertBlockingAllowed(),
    AssertLongCPUWorkAllowed is used in FinalizeLauncherIconInBackground()
    and in CreateLauncherIconFromFaviconInBackground().
    
    Original CL intention was:
    This CL uses ScopedBlockingCall to mark blocking calls in /chrome/browser/android/webapps.
    
    This CL was created by replacing calls to AssertBlockingAllowed()
    with instantiations of ScopedBlockingCall(MAY_BLOCK).
    I kindly ask the reviewer to 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/WILL_BLOCK). 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().
    
    This CL was uploaded by git cl split.
    
    R=dominickn@chromium.org
    
    Bug: 874080
    Change-Id: I31ed4164dbd93d424b7a3a69f833519d13c6fbf1
    Reviewed-on: https://chromium-review.googlesource.com/1191185Reviewed-by: default avatarDominick Ng <dominickn@chromium.org>
    Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#593708}
    4f2e41be
shortcut_helper.cc 18.7 KB