• K Moon's avatar
    Replace LoadPageInfo()'s |reload| with a field · 101c5449
    K Moon authored
    Use a new |document_loaded_| field to decide whether or not to call
    FPDFAvail_IsPageAvail() in PDFiumEngine::LoadPageInfo(). This enables
    calling LoadPageInfo() without precisely tracking the correct value for
    the |reload| parameter.
    
    The |reload| parameter is used to defer calls to FPDFAvail_IsPageAvail()
    from LoadPageInfo() until after FinishLoadingDocument() is called, but
    this requires the caller to track whether or not FinishLoadingDocument()
    has been called. It's simpler just to have FinishLoadingDocument()
    directly mark whether or not it has executed.
    
    The |reload| parameter previously was used to decide how to create
    PDFiumPage instances as well, but this usage was eliminated in
    crrev.com/702636. This incidentally made the DCHECK added in that change
    superfluous, so it has been removed in this change.
    
    Bug: 885110
    Change-Id: I33a2d437c2f8abbea655b054c2259d85441d0752
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1857545
    Commit-Queue: Lei Zhang <thestig@chromium.org>
    Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
    Auto-Submit: K Moon <kmoon@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#708178}
    101c5449
pdfium_engine.h 28.1 KB