Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions | Variables
nsDownloadManager.cpp File Reference
#include "nsDownloadManager.h"
#include "nsIWebProgress.h"
#include "nsIRDFLiteral.h"
#include "rdf.h"
#include "nsNetUtil.h"
#include "nsIDOMWindow.h"
#include "nsIDOMWindowInternal.h"
#include "nsIDOMEvent.h"
#include "nsIDOMEventTarget.h"
#include "nsRDFCID.h"
#include "nsAppDirectoryServiceDefs.h"
#include "nsIWebBrowserPersist.h"
#include "nsIObserver.h"
#include "nsIProgressDialog.h"
#include "nsIWindowWatcher.h"
#include "nsIStringBundle.h"
#include "nsCRT.h"
#include "nsIWindowMediator.h"
#include "nsIPromptService.h"
#include "nsIObserverService.h"
#include "nsIProfileChangeStatus.h"
#include "nsIPrefService.h"
#include "nsIFileURL.h"
#include "nsIAlertsService.h"
#include "nsEmbedCID.h"
#include "nsInt64.h"

Go to the source code of this file.

Defines

#define DOWNLOAD_MANAGER_FE_URL   "chrome://communicator/content/downloadmanager/downloadmanager.xul"
#define DOWNLOAD_MANAGER_BUNDLE   "chrome://communicator/locale/downloadmanager/downloadmanager.properties"

Functions

static nsresult GetFilePathUTF8 (nsIURI *aURI, nsACString &aResult)
 This function extracts the local file path corresponding to the given URI.
 NS_IMPL_ISUPPORTS6 (nsDownload, nsIDownload, nsIDownload_MOZILLA_1_8_BRANCH, nsITransfer, nsIWebProgressListener, nsIWebProgressListener2, nsIObserver) nsDownload

Variables

static const nsInt64 gInterval ((PRUint32)(400 *PR_USEC_PER_MSEC))
static nsIRDFResourcegNC_DownloadsRoot = nsnull
static nsIRDFResourcegNC_File = nsnull
static nsIRDFResourcegNC_URL = nsnull
static nsIRDFResourcegNC_Name = nsnull
static nsIRDFResourcegNC_ProgressMode = nsnull
static nsIRDFResourcegNC_ProgressPercent = nsnull
static nsIRDFResourcegNC_Transferred = nsnull
static nsIRDFResourcegNC_DownloadState = nsnull
static nsIRDFResourcegNC_StatusText = nsnull
static nsIRDFServicegRDFService = nsnull
static PRInt32 gRefCnt = 0

Define Documentation

#define DOWNLOAD_MANAGER_BUNDLE   "chrome://communicator/locale/downloadmanager/downloadmanager.properties"

Definition at line 76 of file nsDownloadManager.cpp.

#define DOWNLOAD_MANAGER_FE_URL   "chrome://communicator/content/downloadmanager/downloadmanager.xul"

Definition at line 75 of file nsDownloadManager.cpp.


Function Documentation

static nsresult GetFilePathUTF8 ( nsIURI aURI,
nsACString &  aResult 
) [static]

This function extracts the local file path corresponding to the given URI.

Definition at line 98 of file nsDownloadManager.cpp.

{
  nsresult rv;

  nsCOMPtr<nsIFileURL> fileURL = do_QueryInterface(aURI, &rv);
  if (NS_FAILED(rv)) return rv;

  nsCOMPtr<nsIFile> file;
  rv = fileURL->GetFile(getter_AddRefs(file));
  if (NS_FAILED(rv)) return rv;

  nsAutoString path;
  rv = file->GetPath(path);
  if (NS_SUCCEEDED(rv))
    CopyUTF16toUTF8(path, aResult);
  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 893 of file nsDownloadManager.cpp.

                                                   :
                         mDownloadManager(aManager),
                         mTarget(aTarget),
                         mSource(aSource),
                         mCancelable(aCancelable),
                         mDownloadState(NOTSTARTED),
                         mPercentComplete(0),
                         mCurrBytes(LL_ZERO),
                         mMaxBytes(LL_ZERO),
                         mStartTime(LL_ZERO),
                         mLastUpdate(PR_Now() - (PRUint32)gInterval),
                         mSpeed(0)
{
}

Variable Documentation

Definition at line 80 of file nsDownloadManager.cpp.

Definition at line 87 of file nsDownloadManager.cpp.

Definition at line 81 of file nsDownloadManager.cpp.

Definition at line 83 of file nsDownloadManager.cpp.

Definition at line 84 of file nsDownloadManager.cpp.

Definition at line 85 of file nsDownloadManager.cpp.

Definition at line 88 of file nsDownloadManager.cpp.

Definition at line 86 of file nsDownloadManager.cpp.

Definition at line 82 of file nsDownloadManager.cpp.

Definition at line 90 of file nsDownloadManager.cpp.

PRInt32 gRefCnt = 0 [static]

Definition at line 92 of file nsDownloadManager.cpp.