• Evan Stade's avatar
    Allow sudden termination of renderers that are stuck in beforeunload. · 2b3f2a52
    Evan Stade authored
    The beforeunload timer in RenderFrameHostImpl may take a long time to
    actually run if there are other tasks queued before it in the ui thread
    task runner. This change allows sudden termination in the case where
    the user tries to close a tab, the timeout fails to fire quickly, and
    the user tries to close the tab again.
    
    This also skips the close event if beforeunload has already timed out
    (not allowing the renderer another chance to time out).
    
    This allows the user to close, in relatively short order, tabs that
    run the following:
    
      while (true) console.log("bar");
    
    Whether that's in a general context, in the beforeunload handler,
    or both.
    
    Bug: 1056257
    Change-Id: Idf1242dab5f06e347cf5fc2ca1019255f0da774e
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2092123Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
    Reviewed-by: default avatarCharlie Reis <creis@chromium.org>
    Commit-Queue: Evan Stade <estade@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#748353}
    2b3f2a52
render_frame_host_impl.h 123 KB