Bug 1432409 part 2 - Make RemotePrintJobChild::OnStatusChange no-op if initialization failed. r=dholbert
authorJonathan Watt <jwatt@jwatt.org>
Mon, 19 Feb 2018 23:25:30 +0000
changeset 404433 9cd1539c04f9ed36465d84348c23fe8fe0be81dc
parent 404432 bd244079d11a95e00a0c01de562f7735075e07dc
child 404454 56a805f8ce42532d6c735e8818d14823f8e9fa0a
push id100012
push userjwatt@jwatt.org
push dateTue, 20 Feb 2018 09:26:52 +0000
treeherdermozilla-inbound@9cd1539c04f9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1432409
milestone60.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1432409 part 2 - Make RemotePrintJobChild::OnStatusChange no-op if initialization failed. r=dholbert After the part 1 fix, we can still (asynchronously) call some generic cleanup code that tries to let the parent process's RemotePrintJobParent know that printing failed under the stack: RemotePrintJobChild::OnStatusChange nsPrintData::DoOnStatusChange nsPrintJob::FirePrintingErrorEvent nsPrintJob::CleanupOnFailure We crash on trying to use the RemotePrintJobChild to message the parent process since the delete message from the parent has been processed. This change makes RemotePrintJobChild::OnStatusChange check that it's initialized before trying to send any messages. Pushing to CLOSED TREE since this passed a full Try build and is a topcrash we want to land for beta ASAP. MozReview-Commit-ID: FfizRMj2s2m
layout/printing/ipc/RemotePrintJobChild.cpp
--- a/layout/printing/ipc/RemotePrintJobChild.cpp
+++ b/layout/printing/ipc/RemotePrintJobChild.cpp
@@ -149,17 +149,17 @@ RemotePrintJobChild::OnLocationChange(ns
   return NS_OK;
 }
 
 NS_IMETHODIMP
 RemotePrintJobChild::OnStatusChange(nsIWebProgress* aProgress,
                                     nsIRequest* aRequest, nsresult aStatus,
                                     const char16_t* aMessage)
 {
-  if (!mDestroyed) {
+  if (NS_SUCCEEDED(mInitializationResult) && !mDestroyed) {
     Unused << SendStatusChange(aStatus);
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 RemotePrintJobChild::OnSecurityChange(nsIWebProgress* aProgress,