• Arthur Sonzogni's avatar
    Update MojoAsyncResourceHandler. Always send response's body datapipe. · 9aca9fc8
    Arthur Sonzogni authored
    Instead of creating the response's body data pipe during the first call to
    OnWillRead(), it is now done in OnWillStart(). The data pipe
    consumer handle is available in OnResponseStarted().
    
    It allows the MojoAsyncResourceHandler to call:
     * URLLoader::OnReceiveResponse(response_headers)
     * URLLoader::OnStartLoadingResponseBody(response_body)
    at the same time.
    
    The goal is to guarantee the response's body is always sent, even if it doesn't
    contains any data.
    
    Bug: 831155, 826868
    Change-Id: I85d84d05ad3fd362d96394834e14297d550f5f13
    Reviewed-on: https://chromium-review.googlesource.com/c/1352254Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
    Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#612137}
    9aca9fc8
mojo_async_resource_handler.h 7.17 KB