Bug 1419775 - Part 2.Notify closing IPC connection to PrintProgressService. r?bobowen
If the content process which is printing target content is closed
during printing, PrintProgressService will continue to display
progress dialog even if Cancel is clicked.
This patch will:
* If IPC connection is closed, notify to PrintProgressService via
nsIWebProgressListener.
MozReview-Commit-ID: DoOfJjnk1wJ
--- a/layout/printing/ipc/RemotePrintJobParent.cpp
+++ b/layout/printing/ipc/RemotePrintJobParent.cpp
@@ -271,12 +271,20 @@ RemotePrintJobParent::~RemotePrintJobPar
void
RemotePrintJobParent::ActorDestroy(ActorDestroyReason aWhy)
{
if (mPrintDeviceContext) {
mPrintDeviceContext->UnregisterPageDoneCallback();
}
mIsDoingPrinting = false;
+
+ // If progress dialog is opened, notify closing it.
+ for (auto listener : mPrintProgressListeners) {
+ listener->OnStateChange(nullptr,
+ nullptr,
+ nsIWebProgressListener::STATE_STOP,
+ NS_OK);
+ }
}
} // namespace layout
} // namespace mozilla