• Arthur Sonzogni's avatar
    Simplify BlobURLLoader and always send OnStartLoadingResponseBody. · c25c2041
    Arthur Sonzogni authored
    This is a sort of prerequisite for:
    https://chromium-review.googlesource.com/c/chromium/src/+/1172290
    
    The main goal is after sending:
      URLLoaderClient::OnReceiveResponse(response_header)
    to ALWAYS send:
      URLLoaderClient::OnStartLoadingResponseBody(response_body)
    
    Some URLLoader, when the response's body body is empty, don't even try to send
    the response_body data pipe. In the URLLoaderClient, not having to handle the
    case with no data pipe would be a nice simplification.
    
    What this CL does:
    1) In BlobUrlLoader, create the data pipe at ::Start() time.
    2) Pass the producer handle to the MojoBlobCreate at construction time.
    3) Pass the consumer handle to OnStartLoadingResponseBody(), immediately
       after OnReceiveResponse().
    
    Some code simplification was possible. There is no more need to
    implement PassDataPipe() in BlobURLLoader, ReaderDelegate and
    DataPipeReaderDelegate. There is no more need to give them the pipe at
    construction time neither.
    
    Bug: 826868, 831155
    Change-Id: I827cb39bdd782624ff362874e98be90cab0d47f3
    Reviewed-on: https://chromium-review.googlesource.com/c/1329741Reviewed-by: default avatarMarijn Kruisselbrink <mek@chromium.org>
    Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#607266}
    c25c2041
mojo_blob_reader.cc 9.37 KB