Bug 1301056 - Fix auto-closing of windows when they divert to an external app.
It appears that we always meant to call
nsExternalHelperAppService::OnStartRequest even before we diverted (there's a
check for XRE_IsChildProcess in there) but forgot to. With this patch, we call
nsExternalHelperAppService::MaybeCloseWindow in the child and restore the old
behavior.
MozReview-Commit-ID: JedU3E0Eu26
--- a/uriloader/exthandler/ExternalHelperAppChild.cpp
+++ b/uriloader/exthandler/ExternalHelperAppChild.cpp
@@ -55,24 +55,24 @@ ExternalHelperAppChild::OnDataAvailable(
//////////////////////////////////////////////////////////////////////////////
// nsIRequestObserver
//////////////////////////////////////////////////////////////////////////////
NS_IMETHODIMP
ExternalHelperAppChild::OnStartRequest(nsIRequest *request, nsISupports *ctx)
{
+ nsresult rv = mHandler->OnStartRequest(request, ctx);
+ NS_ENSURE_SUCCESS(rv, NS_ERROR_UNEXPECTED);
+
nsCOMPtr<nsIDivertableChannel> divertable = do_QueryInterface(request);
if (divertable) {
return DivertToParent(divertable, request);
}
- nsresult rv = mHandler->OnStartRequest(request, ctx);
- NS_ENSURE_SUCCESS(rv, NS_ERROR_UNEXPECTED);
-
nsCString entityID;
nsCOMPtr<nsIResumableChannel> resumable(do_QueryInterface(request));
if (resumable) {
resumable->GetEntityID(entityID);
}
SendOnStartRequest(entityID);
return NS_OK;
}