DownloadDevice.cpp File Reference
#include "DownloadDevice.h"
#include <nsArrayUtils.h>
#include <nsAutoLock.h>
#include <nsComponentManagerUtils.h>
#include <nsCRT.h>
#include <nsIDOMWindow.h>
#include <nsILocalFile.h>
#include <nsINetUtil.h>
#include <nsIProperties.h>
#include <nsIStandardURL.h>
#include <nsIFileURL.h>
#include <nsISupportsPrimitives.h>
#include <nsITreeView.h>
#include <nsIURL.h>
#include <nsIUTF8ConverterService.h>
#include <nsIWindowWatcher.h>
#include <nsIResumableChannel.h>
#include <nsServiceManagerUtils.h>
#include <nsNetUtil.h>
#include <nsUnicharUtils.h>
#include <prmem.h>
#include <sbILibraryManager.h>
#include <sbILocalDatabaseLibrary.h>
#include <sbIFileMetadataService.h>
#include <sbIJobProgress.h>
#include <sbIPropertyManager.h>
#include <sbStandardProperties.h>
#include <nsIChannel.h>
#include <prprf.h>
Include dependency graph for DownloadDevice.cpp:

Go to the source code of this file.

Macros

#define SB_DOWNLOAD_DEVICE_CATEGORY   NS_LITERAL_STRING("Songbird Download Device").get()
 
#define SB_DOWNLOAD_DEVICE_ID   "download"
 
#define SB_DOWNLOAD_DIR_DR   "download.folder"
 
#define SB_TMP_DIR   "Songbird"
 
#define SB_DOWNLOAD_TMP_DIR   "DownloadDevice"
 
#define SB_DOWNLOAD_LIST_NAME   "&chrome://songbird/locale/songbird.properties#device.download"
 
#define SB_STRING_BUNDLE_CHROME_URL   "chrome://songbird/locale/songbird.properties"
 
#define SB_DOWNLOAD_COL_SPEC   "http://songbirdnest.com/data/1.0#trackName 179 http://songbirdnest.com/data/1.0#artistName 115 http://songbirdnest.com/data/1.0#albumName 115 http://songbirdnest.com/data/1.0#originPageImage 43 http://songbirdnest.com/data/1.0#downloadDetails 266 http://songbirdnest.com/data/1.0#downloadButton 73"
 
#define SB_PREF_DOWNLOAD_MEDIALIST   "songbird.library.download"
 
#define SB_PREF_WEB_LIBRARY   "songbird.library.web"
 
#define SB_DOWNLOAD_CUSTOM_TYPE   "download"
 
#define SB_DOWNLOAD_PROGRESS_UPDATE_PERIOD_MS   1000
 
#define SB_DOWNLOAD_IDLE_TIMEOUT_MS   (60*1000)
 
#define SB_DOWNLOAD_PROGRESS_TIMER_MS   1000
 
#define TRACE(args)   /* nothing */
 
#define LOG(args)   /* nothing */
 

Functions

static PRInt32 codetovalue (unsigned char c)
 
static PRStatus decode4to3 (const unsigned char *src, unsigned char *dest)
 
static PRStatus decode3to2 (const unsigned char *src, unsigned char *dest)
 
static PRStatus decode2to1 (const unsigned char *src, unsigned char *dest)
 
static PRStatus decode (const unsigned char *src, PRUint32 srclen, unsigned char *dest)
 
char * SB_Base64Decode (const char *src, PRUint32 srclen, char *dest)
 
nsCString GetContentDispositionFilename (const nsACString &contentDisposition)
 
 NS_IMPL_ISUPPORTS4 (sbDownloadDevice, nsIObserver, sbIDeviceBase, sbIDownloadDevice, sbIMediaListListener) sbDownloadDevice
 
 NS_IMPL_THREADSAFE_ISUPPORTS2 (sbDownloadSession, nsIWebProgressListener, nsITimerCallback) NS_IMETHODIMP sbDownloadSession
 
 NS_IMPL_ISUPPORTS1 (sbDownloadSession::LibraryMetadataUpdater, sbIMediaListEnumerationListener) NS_IMETHODIMP sbDownloadSession
 Called when enumeration is about to begin. More...
 
 NS_IMPL_ISUPPORTS1 (sbDownloadSession::WebLibraryUpdater, sbIMediaListEnumerationListener) NS_IMETHODIMP sbDownloadSession
 Called when enumeration is about to begin. More...
 
 NS_IMPL_THREADSAFE_ISUPPORTS1 (sbDownloadSessionMoveHandler, nsIRunnable) NS_IMETHODIMP sbDownloadSessionMoveHandler
 

Macro Definition Documentation

#define LOG (   args)    /* nothing */

Definition at line 141 of file DownloadDevice.cpp.

#define SB_DOWNLOAD_COL_SPEC   "http://songbirdnest.com/data/1.0#trackName 179 http://songbirdnest.com/data/1.0#artistName 115 http://songbirdnest.com/data/1.0#albumName 115 http://songbirdnest.com/data/1.0#originPageImage 43 http://songbirdnest.com/data/1.0#downloadDetails 266 http://songbirdnest.com/data/1.0#downloadButton 73"

Definition at line 118 of file DownloadDevice.cpp.

#define SB_DOWNLOAD_CUSTOM_TYPE   "download"

Definition at line 123 of file DownloadDevice.cpp.

#define SB_DOWNLOAD_DEVICE_CATEGORY   NS_LITERAL_STRING("Songbird Download Device").get()

Definition at line 108 of file DownloadDevice.cpp.

#define SB_DOWNLOAD_DEVICE_ID   "download"

Definition at line 110 of file DownloadDevice.cpp.

#define SB_DOWNLOAD_DIR_DR   "download.folder"

Definition at line 111 of file DownloadDevice.cpp.

#define SB_DOWNLOAD_IDLE_TIMEOUT_MS   (60*1000)

Definition at line 125 of file DownloadDevice.cpp.

#define SB_DOWNLOAD_LIST_NAME   "&chrome://songbird/locale/songbird.properties#device.download"

Definition at line 114 of file DownloadDevice.cpp.

#define SB_DOWNLOAD_PROGRESS_TIMER_MS   1000

Definition at line 126 of file DownloadDevice.cpp.

#define SB_DOWNLOAD_PROGRESS_UPDATE_PERIOD_MS   1000

Definition at line 124 of file DownloadDevice.cpp.

#define SB_DOWNLOAD_TMP_DIR   "DownloadDevice"

Definition at line 113 of file DownloadDevice.cpp.

#define SB_PREF_DOWNLOAD_MEDIALIST   "songbird.library.download"

Definition at line 121 of file DownloadDevice.cpp.

#define SB_PREF_WEB_LIBRARY   "songbird.library.web"

Definition at line 122 of file DownloadDevice.cpp.

#define SB_STRING_BUNDLE_CHROME_URL   "chrome://songbird/locale/songbird.properties"

Definition at line 116 of file DownloadDevice.cpp.

#define SB_TMP_DIR   "Songbird"

Definition at line 112 of file DownloadDevice.cpp.

#define TRACE (   args)    /* nothing */

Definition at line 140 of file DownloadDevice.cpp.

Function Documentation

static PRInt32 codetovalue ( unsigned char  c)
static

Definition at line 150 of file DownloadDevice.cpp.

Here is the caller graph for this function:

static PRStatus decode ( const unsigned char *  src,
PRUint32  srclen,
unsigned char *  dest 
)
static

Definition at line 278 of file DownloadDevice.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

static PRStatus decode2to1 ( const unsigned char *  src,
unsigned char *  dest 
)
static

Definition at line 247 of file DownloadDevice.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

static PRStatus decode3to2 ( const unsigned char *  src,
unsigned char *  dest 
)
static

Definition at line 206 of file DownloadDevice.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

static PRStatus decode4to3 ( const unsigned char *  src,
unsigned char *  dest 
)
static

Definition at line 179 of file DownloadDevice.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsCString GetContentDispositionFilename ( const nsACString &  contentDisposition)

Definition at line 378 of file DownloadDevice.cpp.

Here is the call graph for this function:

NS_IMPL_ISUPPORTS1 ( sbDownloadSession::LibraryMetadataUpdater  ,
sbIMediaListEnumerationListener   
)

Called when enumeration is about to begin.

Parameters
aMediaList- The media list that is being enumerated.
Returns
true to begin enumeration, false to cancel.

Definition at line 4073 of file DownloadDevice.cpp.

NS_IMPL_ISUPPORTS1 ( sbDownloadSession::WebLibraryUpdater  ,
sbIMediaListEnumerationListener   
)

Called when enumeration is about to begin.

Parameters
aMediaList- The media list that is being enumerated.
Returns
true to begin enumeration, false to cancel.

Definition at line 4176 of file DownloadDevice.cpp.

Definition at line 494 of file DownloadDevice.cpp.

NS_IMPL_THREADSAFE_ISUPPORTS1 ( sbDownloadSessionMoveHandler  ,
nsIRunnable   
)

Definition at line 4283 of file DownloadDevice.cpp.

NS_IMPL_THREADSAFE_ISUPPORTS2 ( sbDownloadSession  ,
nsIWebProgressListener  ,
nsITimerCallback   
)

Notification indicating the state has changed for one of the requests associated with aWebProgress.

Parameters
aWebProgressThe nsIWebProgress instance that fired the notification
aRequestThe nsIRequest that has changed state.
aStateFlagsFlags indicating the new state. This value is a combination of one of the State Transition Flags and one or more of the State Type Flags defined above. Any undefined bits are reserved for future use.
aStatusError status code associated with the state change. This parameter should be ignored unless aStateFlags includes the STATE_STOP bit. The status code indicates success or failure of the request associated with the state change. NOTE: aStatus may be a success code even for server generated errors, such as the HTTP 404 error. In such cases, the request itself should be queried for extended error information (e.g., for HTTP requests see nsIHttpChannel).

Definition at line 3051 of file DownloadDevice.cpp.

char* SB_Base64Decode ( const char *  src,
PRUint32  srclen,
char *  dest 
)

Definition at line 319 of file DownloadDevice.cpp.

Here is the call graph for this function:

Here is the caller graph for this function: