• Hui Yingst's avatar
    Add handling for downloading attachments in OutOfProcessInstance. · 52723925
    Hui Yingst authored
    Add message handler HandleSaveAttachmentMessage() for downloading PDF
    attachments.
    
    As the caller of PDFiumEngine::GetAttachmentData(),
    HandleSaveAttachmentMessage() validates the attachment's index,
    readability and whether the size is non-zero before calling, and checks
    whether the returned attachment's size matches the stored attachment
    size in |doc_attachment_info_list_|.
    
    After calling GetAttachmentData() to fetch the attachment's data,
    HandleSaveAttachmentMessage() posts a reply to save the data to
    disk.
    
    Bug: 177188
    Change-Id: I34ad386447cdcb4025d0f545e4ff8b9d3b818659
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2295998
    Commit-Queue: Hui Yingst <nigi@chromium.org>
    Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#798865}
    52723925
out_of_process_instance.cc 79.9 KB