Bug 383807 - Explain why we are not checking the result of new in nsExternalProtocolHander.cpp. Patch by Ryan Jones <sciguyryan@gmail.com>. r=cbiesinger, sr=dmose
--- a/uriloader/exthandler/nsExternalProtocolHandler.cpp
+++ b/uriloader/exthandler/nsExternalProtocolHandler.cpp
@@ -320,16 +320,18 @@ NS_IMETHODIMP nsExtProtocolChannel::Asyn
if (NS_SUCCEEDED(rv)) {
// redirecting to the web handler involvegs calling OnChannelRedirect,
// which is supposed to happen after AsyncOpen completes, so we do it in an
// event
nsCOMPtr<nsIRunnable> event = new nsWebProtocolRedirect(mUrl, uriTemplate,
listener, ctxt,
this);
+ // We don't check if |event| was successfully created because
+ // |NS_DispatchToCurrentThread| will do that for us.
rv = NS_DispatchToCurrentThread(event);
if (NS_SUCCEEDED(rv)) {
return rv;
}
}
// try for an OS-provided handler
OpenURL();