Bug 455913 - nsIHelperAppLauncher should provide info about content length. r+sr=cbiesinger.
--- a/uriloader/exthandler/nsExternalHelperAppService.cpp
+++ b/uriloader/exthandler/nsExternalHelperAppService.cpp
@@ -1149,16 +1149,22 @@ NS_IMETHODIMP nsExternalAppHandler::GetT
}
NS_IMETHODIMP nsExternalAppHandler::GetTimeDownloadStarted(PRTime* aTime)
{
*aTime = mTimeDownloadStarted;
return NS_OK;
}
+NS_IMETHODIMP nsExternalAppHandler::GetContentLength(PRInt64 *aContentLength)
+{
+ *aContentLength = mContentLength;
+ return NS_OK;
+}
+
NS_IMETHODIMP nsExternalAppHandler::CloseProgressWindow()
{
// release extra state...
mWebProgressListener = nsnull;
return NS_OK;
}
void nsExternalAppHandler::RetargetLoadNotifications(nsIRequest *request)
--- a/uriloader/exthandler/nsIExternalHelperAppService.idl
+++ b/uriloader/exthandler/nsIExternalHelperAppService.idl
@@ -161,9 +161,14 @@ interface nsIHelperAppLauncher : nsICanc
* The executable-ness of the target file
*/
readonly attribute boolean targetFileIsExecutable;
/**
* Time when the download started
*/
readonly attribute PRTime timeDownloadStarted;
+
+ /**
+ * The download content length, or -1 if the length is not available.
+ */
+ readonly attribute PRInt64 contentLength;
};