• Florin Malita's avatar
    Fix parsing of segmented WebRequest formData · afccef39
    Florin Malita authored
    After https://chromium-review.googlesource.com/c/chromium/src/+/581748
    we no longer flatten SharedBuffers in GetRequestBodyForWebHTTPBody()
    but instead pass segmented data downstream (multiple DataElements).
    
    This minimizes unnecessary reallocations/copies in general, but relies
    on downstream clients being able to handle segmented data (or flatten it
    on the fly if really needed).
    
    Turns out WebRequest's FormDataParsers assume the input buffers are
    flattened (or segmented along expected chunk boundaries for multipart).
    
    This CL adds a buffering mechanism to ParsedDataPresenter which flattens
    consecutive byte segments before passing down to the parser.
    
    BUG=831169
    
    Change-Id: Ibea9193ff783cad0c80bb9722f719ff063b65720
    Reviewed-on: https://chromium-review.googlesource.com/1011322
    Commit-Queue: Florin Malita <fmalita@chromium.org>
    Reviewed-by: default avatarKen Rockot <rockot@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#551344}
    afccef39
upload_data_presenter.h 4.38 KB