• Gabriel Charette's avatar
    [RenderProcessHost/Desktop] Update process priority on process launch and fix... · c492203d
    Gabriel Charette authored
    [RenderProcessHost/Desktop] Update process priority on process launch and fix navigation priority inversion
    
    This is a second take on
    https://chromium-review.googlesource.com/c/chromium/src/+/754299
    
    It's under an experiment to (1) be able to see the side-effects and (2)
    make merge to M69 easier. Intentionally kept old (and buggy) behavior
    intact under the non-experimental branch for comparison.
    
    This fixes all aspects of crbug.com/560446:
     1) Fixes the OP better than r385608 did.
     2) Fixes the side-effect of r385608 which was to default all tabs
        created backgrounded to run at foreground priority until visiblity
        was toggle on/off again.
     3) Fixes a major priority inversion on foreground navigation which
        could cause them to background their associated renderer while
        navigation (which reintroduced the OP but worse since all background
        tabs were running foregrounded per r385608)...
        See https://crbug.com/560446#c74 for details.
    
    Updated ChildProcessLauncherPriority::is_background() to consistently
    reflect backgrounding decision to all callers and renamed
    |ChildProcessLauncherPriority::foreground| to
    |ChildProcessLauncherPriority::visible| to better reflect that it's a
    property but not the resulting foreground/background state.
    
    See in code comment on ShouldBoostPriorityForPendingViews() for more
    details.
    
    TBR=haraken@chromium.org (side-effect in third_party/blink)
    
    Bug: 560446
    Change-Id: I901b702506a44704b53c007bcdd498fb60824e94
    Reviewed-on: https://chromium-review.googlesource.com/1142593
    Commit-Queue: Gabriel Charette <gab@chromium.org>
    Reviewed-by: default avatarNasko Oskov <nasko@chromium.org>
    Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
    Reviewed-by: default avatarBo <boliu@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#585918}
    c492203d
child_process_launcher.cc 6.51 KB