зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1784554 - Return Input Stream Earlier for GeckoView Save to PDF r=geckoview-reviewers,amejiamarmol,owlish,emilio
Patch returns the input stream earlier for save to PDF. It now uses SendError when the PDF does not process. Differential Revision: https://phabricator.services.mozilla.com/D158702
This commit is contained in:
Родитель
3a8f47bb4a
Коммит
d2bed2b014
|
@ -1808,17 +1808,15 @@ void GeckoViewSupport::PrintToPdf(
|
|||
RefPtr<CanonicalBrowsingContext::PrintPromise> print =
|
||||
cbc->Print(printSettings);
|
||||
|
||||
geckoResult->Complete(stream);
|
||||
print->Then(
|
||||
mozilla::GetCurrentSerialEventTarget(), __func__,
|
||||
[result = java::GeckoResult::GlobalRef(geckoResult), stream, pdfErrorMsg](
|
||||
const CanonicalBrowsingContext::PrintPromise::ResolveOrRejectValue&
|
||||
aValue) {
|
||||
if (aValue.IsReject()) {
|
||||
result->CompleteExceptionally(
|
||||
IllegalStateException::New(pdfErrorMsg).Cast<jni::Throwable>());
|
||||
GVS_LOG("Could not print.");
|
||||
} else {
|
||||
result->Complete(stream);
|
||||
GVS_LOG("Could not print. %s", pdfErrorMsg);
|
||||
stream->SendError();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче