mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
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:
parent
3a8f47bb4a
commit
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();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user