• danakj's avatar
    Avoid using killed renderers when restarting after enrollment · da7b2ee3
    danakj authored
    When enrollment completes, WizardController may restart chrome. Part of
    that restart does a fast shutdown on every RenderProcessHost, killing
    all renderers.
    
    However there may be tasks waiting to run that are IPC replies from the
    webui renderer. Once such task is
    EnrollmentScreenHandler::DoShowWithPartition().
    
    The OobeConfigurationRollbackTest.TestEnterpriseRollbackRecover test
    causes this restart to happen. Then as the test is ending, it runs
    the message loop a number of times. If the renderer's reply happens to
    be sent before being killed, and then arrives in the browser, the test
    will run DoShowWithPartition(). This attempts to run JS in the
    renderer which has been destroyed already. This becomes a crash when
    we tear down the mojo connection with the renderer-process frame in
    https://chromium-review.googlesource.com/c/chromium/src/+/2593750.
    
    Rather than have CallJS() or some high-level object check if the
    RenderFrame exists, which would hide logic errors, we inform the
    EnrollmentScreen from WizardController when it is restarting chrome.
    Then the EnrollmentScreenHandler can stop trying to talk to non-
    existent renderer processes. We do this from WizardController because
    EnrollmentScreen does not know this is happening on its own, as the
    decision making about this is done up in WizardController.
    
    R=achuith@chromium.org
    
    Bug: 1158869
    Change-Id: I83b6af31a463fa94869035f960b27bd8195a89fe
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2629576Reviewed-by: default avatarDenis Kuznetsov [CET] <antrim@chromium.org>
    Reviewed-by: default avatarAchuith Bhandarkar <achuith@chromium.org>
    Commit-Queue: danakj <danakj@chromium.org>
    Auto-Submit: danakj <danakj@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#845173}
    da7b2ee3
enrollment_screen.cc 20.4 KB