Bug 1368343 - Be paranoid about null TabChild. r=billm, a=gchang
authorBlake Kaplan <mrbkap@gmail.com>
Thu, 31 Aug 2017 16:54:31 -0700
changeset 423958 d72533fac3a844b075009ee4a5aab5720b3224f2
parent 423957 3b2becf0295ba7f42c9241aed598165d94dd1582
child 423959 a000b6bed029de20f39d13d611dc5bff5d301eb0
push id1517
push userjlorenzo@mozilla.com
push dateThu, 14 Sep 2017 16:50:54 +0000
treeherdermozilla-release@3b41fd564418 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbillm, gchang
bugs1368343
milestone56.0
Bug 1368343 - Be paranoid about null TabChild. r=billm, a=gchang I had a theory about what was happening (that we're somehow closing the window between the attempt to open the channel and the resulting OnStartRequest), but when I attempted to test that I couldn't make it crash (in fact, closing the window calls Cancel on the stream and stops the OnStartRequest from happening). So, I don't know what's causing this, but clearly we're failing to get a TabChild out, so let's stop crashing for the time being. MozReview-Commit-ID: LeGJCvh26dm
uriloader/exthandler/ExternalHelperAppChild.cpp
--- a/uriloader/exthandler/ExternalHelperAppChild.cpp
+++ b/uriloader/exthandler/ExternalHelperAppChild.cpp
@@ -68,17 +68,17 @@ ExternalHelperAppChild::OnStartRequest(n
   // loaded for. In that case, the TabParent in the parent context might then
   // point to the wrong window. Re-send the window context along with either
   // DivertToParent or SendOnStartRequest just in case.
   nsCOMPtr<nsPIDOMWindowOuter> window =
     do_GetInterface(mHandler->GetDialogParent());
   NS_ENSURE_TRUE(window, NS_ERROR_NOT_AVAILABLE);
 
   TabChild *tabChild = mozilla::dom::TabChild::GetFrom(window);
-  MOZ_ASSERT(tabChild);
+  NS_ENSURE_TRUE(tabChild, NS_ERROR_NOT_AVAILABLE);
 
   nsCOMPtr<nsIDivertableChannel> divertable = do_QueryInterface(request);
   if (divertable) {
     return DivertToParent(divertable, request, tabChild);
   }
 
   nsCString entityID;
   nsCOMPtr<nsIResumableChannel> resumable(do_QueryInterface(request));