Bug 1432409 part 2 - Make RemotePrintJobChild::OnStatusChange no-op if initialization failed. r=dholbert, a=lizzard
authorJonathan Watt <jwatt@jwatt.org>
Mon, 19 Feb 2018 23:25:30 +0000
changeset 454937 0788981ad3266054b86bd77ef23ad8c8ec58825b
parent 454936 9002f06257c6ca8f58ec761f65a6ea0d90a35e25
child 454938 64567978e14ea8332461f5133db4ebe2609d5c32
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert, lizzard
bugs1432409
milestone59.0
Bug 1432409 part 2 - Make RemotePrintJobChild::OnStatusChange no-op if initialization failed. r=dholbert, a=lizzard 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,