Bug 1368343 - Be paranoid about null TabChild. r=billm
authorBlake Kaplan <mrbkap@gmail.com>
Thu, 31 Aug 2017 16:54:31 -0700
changeset 378330 dc69549547d0d420d0be9524f52cd87bfc853e39
parent 378329 f3626e650d8ea1f0dc230a1053bf97fbc6512360
child 378331 a2869adf00c57a0634245842163580bf15164c70
push id32428
push userarchaeopteryx@coole-files.de
push dateSat, 02 Sep 2017 08:52:28 +0000
treeherdermozilla-central@b01a7e57425b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbillm
bugs1368343
milestone57.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 1368343 - Be paranoid about null TabChild. r=billm 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));