Replaces all instances of scoped_refptr<UrlLoader> with
std::unique_ptr<UrlLoader>. It turns out there's no need for multiple
ownership of UrlLoader.
Drops OutOfProcessInstance's embed_loader_ and embed_preview_loader_
fields in favor of binding to the result callback. This may cause
behavioral changes in two cases:
1. The field is overwritten before the callback runs.
2. The field is not cleared after the callback runs.
(1) would cause other problems, as the current code assumes only one
load occurs at a time (as tracked by document_load_state_ and
preview_document_load_state_). The extra fields are needed only to
simulate bound parameters in the old pp::CompletionCallback
implementation.
(2) is the case currently, but this change simply ensures that the
loader is cleaned up as soon as it's no longer needed, rather than
"leaking" a lingering reference.
Retains the form_loader_ field, rather than also binding to the result
callback, as this loader is not handed off to PDFiumEngine. In general,
we don't handle form submission correctly, but fixing this is more a
matter for crbug.com/719344.
Bug: 1099022
Change-Id: I012be0e65583940f08275d7ce3469e01fbf72dda
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2402122
Reviewed-by: Daniel Hosseinian <dhoss@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: K. Moon <kmoon@chromium.org>
Cr-Commit-Position: refs/heads/master@{#805807}