• ananta's avatar
    Add support for subresource request fallback in AppCache for the network service.. · 2ec63638
    ananta authored
    This patch builds on patch https://codereview.chromium.org/2956373002/ for adding fallback
    support for subresource requests. This is implemented by passing a proxy URLLoaderClient
    interface to the network URL service for subresource requests which are sent to the network.
    We intercept the OnReceiveResponse, OnReceiveRedirect and OnComplete calls for supporting
    fallback responses in these cases. We could potentially look at moving fallback response
    reading to the renderer in a later patchset.
    
    The changes in this patchset are as below:
    1. Add support for passing the ResourceResponseHead to the AppCacheURLLoaderJob. This is
       required for supporting fallback responses. The request handler looks at headers in
       the response and the status code to make a call whether a fallback is required.
    
    2. AppCacheRequestHandler::MaybeLoadFallbackForResponse() and MaybeLoadFallbackForRedirect() have
       changed to allow for the fact that they are called in the network service code by the
       AppCacheURLLoaderJob. We don't create new job for delivering the fallback in this case.
    
    3. Added methods in the AppCacheRequest class  to return the URLRequest override and URLLoader
       override respectively.
    
    Next step is to add support for main resource fallback.
    
    BUG=715632
    
    Review-Url: https://codereview.chromium.org/2974733002
    Cr-Commit-Position: refs/heads/master@{#487640}
    2ec63638
appcache_url_loader_job.cc 16 KB