• Ryan Sturm's avatar
    Search Prefetch Streaming requests can be cancelled after headers · 583f52a3
    Ryan Sturm authored
    The goal of this CL is to allow unneeded requests to be cancelled
    when they are unlikely to be navigated to. This is achieved through
    a few avenues of change:
    
    -- When the user navigates to something in omnibox, the URL is reported
    to Search Prefetch Service to be able to mark it as likely to be served
    (using kCanBeServedAndUserClicked when the request is kCanBeServed).
    This occurs before the omnibox is closed and all results are wiped.
    -- kCanBeServed are wiped when omnibox closes.
    -- Streaming requests will no longer pause the mojo channel, so they can
    witness the Complete event to be able to make the request as complete.
    -- As part of above, we store the response body in memory instead of
    just handing off the data pipe. Data pipes have a 500k data limit, which
    search requests typically go over. Net won't send the complete event
    until all data is in the pipe. Therefore we store the data and create a
    pipe to navigation if needed.
    -- Full body implementation now reports kComplete where it used to
    report kCanBeServed.
    
    Bug: 1156325
    Change-Id: Ied70a3eafd896801e263f631cb4d80556e762180
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2583112Reviewed-by: default avatarTarun Bansal <tbansal@chromium.org>
    Reviewed-by: default avatarRobert Ogden <robertogden@chromium.org>
    Commit-Queue: Ryan Sturm <ryansturm@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#835897}
    583f52a3
search_prefetch_service.cc 12.1 KB