зеркало из 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 =
|
RefPtr<CanonicalBrowsingContext::PrintPromise> print =
|
||||||
cbc->Print(printSettings);
|
cbc->Print(printSettings);
|
||||||
|
|
||||||
|
geckoResult->Complete(stream);
|
||||||
print->Then(
|
print->Then(
|
||||||
mozilla::GetCurrentSerialEventTarget(), __func__,
|
mozilla::GetCurrentSerialEventTarget(), __func__,
|
||||||
[result = java::GeckoResult::GlobalRef(geckoResult), stream, pdfErrorMsg](
|
[result = java::GeckoResult::GlobalRef(geckoResult), stream, pdfErrorMsg](
|
||||||
const CanonicalBrowsingContext::PrintPromise::ResolveOrRejectValue&
|
const CanonicalBrowsingContext::PrintPromise::ResolveOrRejectValue&
|
||||||
aValue) {
|
aValue) {
|
||||||
if (aValue.IsReject()) {
|
if (aValue.IsReject()) {
|
||||||
result->CompleteExceptionally(
|
GVS_LOG("Could not print. %s", pdfErrorMsg);
|
||||||
IllegalStateException::New(pdfErrorMsg).Cast<jni::Throwable>());
|
stream->SendError();
|
||||||
GVS_LOG("Could not print.");
|
|
||||||
} else {
|
|
||||||
result->Complete(stream);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче