• Alan Screen's avatar
    Ensure PDF composite failures notify Print Preview UI · 67c4a0f6
    Alan Screen authored
    Follow-on to crrev.com/c/1823801.
    
    From crbug.com/1000936, failures in doing conversion of PDF for Nup
    caused the Print Preview UI to endlessly spin in the
    "Loading preview ..." state without ever showing that it had failed.
    
    Similar behavior can be replicated during development by inducing
    crashes in PDF composition calls inside PdfCompositorImpl.
    
    Wrap the PDF page composition calls' callbacks with
    mojo::WrapCallbackWithDefaultInvokeIfNotRun() so that a status is
    provided even if the utility process disappears before completing.
    
    Update the On<composite-something>Done() callbacks to include a
    notification call to the Print Preview UI to report errors.
    
    Bug: 1003171
    Change-Id: Id351cefd5d91b322a915fa635865969e1cbb1142
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1825661Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
    Commit-Queue: Alan Screen <awscreen@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#700021}
    67c4a0f6
print_preview_message_handler.cc 17.3 KB