Bug 459329 Download Manager should honour --disable-vista-sdk-requirements r=sdwilsh

This commit is contained in:
Neil Rashbrook 2008-10-14 14:48:55 +01:00
parent fd0179d793
commit 434a05f6c1
3 changed files with 16 additions and 13 deletions

View File

@ -75,10 +75,13 @@ CPPSRCS = \
nsDownloadManager.cpp \
$(NULL)
ifndef MOZ_DISABLE_VISTA_SDK_REQUIREMENTS
ifndef GNU_CXX
ifeq ($(OS_ARCH),WINNT)
CPPSRCS += nsDownloadScanner.cpp
REQUIRES += xulapp
DEFINES += -DDOWNLOAD_SCANNER
endif
endif
endif

View File

@ -85,7 +85,7 @@
#if defined(XP_WIN) && !defined(WINCE)
#include <shlobj.h>
#ifndef __MINGW32__
#ifdef DOWNLOAD_SCANNER
#include "nsDownloadScanner.h"
#endif
#endif
@ -139,9 +139,9 @@ nsDownloadManager::GetSingleton()
nsDownloadManager::~nsDownloadManager()
{
#if defined(XP_WIN) && !defined(__MINGW32__)
mScanner = nsnull;
#endif
#ifdef DOWNLOAD_SCANNER
mScanner = nsnull;
#endif
gDownloadManagerService = nsnull;
}
@ -909,7 +909,7 @@ nsDownloadManager::Init()
getter_AddRefs(mBundle));
NS_ENSURE_SUCCESS(rv, rv);
#if defined(XP_WIN) && !defined(__MINGW32__) && !defined(WINCE)
#ifdef DOWNLOAD_SCANNER
mScanner = new nsDownloadScanner();
if (!mScanner)
return NS_ERROR_OUT_OF_MEMORY;
@ -1415,7 +1415,7 @@ nsDownloadManager::AddDownload(DownloadType aDownloadType,
}
DownloadState startState = nsIDownloadManager::DOWNLOAD_QUEUED;
#if defined(XP_WIN) && !defined(__MINGW32__) && !defined(WINCE)
#ifdef DOWNLOAD_SCANNER
if (mScanner) {
AVCheckPolicyState res = mScanner->CheckPolicy(aSource, aTarget);
if (res == AVPOLICY_BLOCKED) {
@ -2065,7 +2065,7 @@ nsDownload::SetState(DownloadState aState)
// Transfers are finished, so break the reference cycle
Finalize();
break;
#if defined(XP_WIN) && !defined(__MINGW32__) && !defined(WINCE)
#ifdef DOWNLOAD_SCANNER
case nsIDownloadManager::DOWNLOAD_SCANNING:
{
nsresult rv = mDownloadManager->mScanner ? mDownloadManager->mScanner->ScanDownload(this) : NS_ERROR_NOT_INITIALIZED;

View File

@ -74,7 +74,7 @@ typedef PRInt16 DownloadType;
class nsDownload;
#if defined(XP_WIN) && !defined(__MINGW32__)
#ifdef DOWNLOAD_SCANNER
#include "nsDownloadScanner.h"
#endif
@ -93,7 +93,7 @@ public:
static nsDownloadManager *GetSingleton();
virtual ~nsDownloadManager();
nsDownloadManager() {};
nsDownloadManager() {};
protected:
nsresult InitDB(PRBool *aDoImport);
@ -239,10 +239,10 @@ protected:
enum QuitBehavior GetQuitBehavior();
// Virus scanner for windows
#if defined(XP_WIN) && !defined(__MINGW32__)
private:
nsRefPtr<nsDownloadScanner> mScanner;
#endif
#ifdef DOWNLOAD_SCANNER
private:
nsRefPtr<nsDownloadScanner> mScanner;
#endif
private:
nsCOMArray<nsIDownloadProgressListener> mListeners;