Bug 455913 - nsIHelperAppLauncher should provide info about content length. r+sr=cbiesinger.
authorOleg Romashin <romaxa@gmail.com>
Mon, 29 Sep 2008 23:37:49 -0500
changeset 19873 81f3072d75be6acfc89674265d504496c15743b3
parent 19872 0f3ed26e4e4d3b010aa10c4c193e2841bc6f875b
child 19874 dd1c08d6d99380380880a513f96bc09fc242bf74
push id2510
push userromaxa@gmail.com
push dateMon, 29 Sep 2008 20:39:00 +0000
treeherdermozilla-central@81f3072d75be [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs455913
milestone1.9.1b1pre
Bug 455913 - nsIHelperAppLauncher should provide info about content length. r+sr=cbiesinger.
uriloader/exthandler/nsExternalHelperAppService.cpp
uriloader/exthandler/nsIExternalHelperAppService.idl
--- 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;
 };