• Lukasz Anforowicz's avatar
    Avoid unbounded queueing of IPC messages for crashed renderers. · b29fffc2
    Lukasz Anforowicz authored
    If a renderer process crashes, then we retain the associated
    RenderProcessHostImpl object (to retain the old render_process_host_id
    that may have been stored elsewhere in the system).  Before this CL this
    had an undesired interaction with the ability of RenderProcessHostImpl
    to queue IPCs between the call to Init and the time when a renderer
    process is actually spawned (disclaimer - in practice the queueing has a
    slightly/undesirably longer timeline).
    
    Before this CL, RenderProcessHostImpl::ProcessDied(...) would call
    EnableSendQueue().  This meant that an unbounded number of IPC messages
    may be accumulated in
    ChannelAssociatedGroupController::outgoing_messages_ (until the crashed
    process is restarted).
    
    After this CL, RenderProcessHostImpl::ProcessDied(...) no longer calls
    EnableSendQueue().
    - Short-term: subsystems that require queueing of IPCs should
      call RPH::EnableSendQueue() themselves (e.g. like RenderViewHostImpl's
      constructor does).
    - Long-term: we should discard IPCs until RenderProcessHostImpl::Init
      is called - queueing should only take place in the short time between
      calling RenderProcessHostImpl::Init and the time the renderer process
      is actually launched.
    
    There is a small risk that this CL will introduce crashes similar to the
    ones seen in https://crbug.com/658759.
    
    Bug: 813045
    Change-Id: I838bf7ea443633ba0f2314d2de5c83891ec9ac5f
    Reviewed-on: https://chromium-review.googlesource.com/1073621Reviewed-by: default avatarNasko Oskov <nasko@chromium.org>
    Reviewed-by: default avatarKen Rockot <rockot@chromium.org>
    Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#562491}
    b29fffc2
ipc_mojo_bootstrap.h 2.09 KB