this checkin is to help fix bug #15393. There is one more step to truly fix it, which will come later. This fix is by dveditz, and reviewed by ssu.

This commit is contained in:
ssu%netscape.com 1999-10-09 21:37:21 +00:00
Родитель 5fa188bc05
Коммит aa476b7903
4 изменённых файлов: 20 добавлений и 22 удалений

Просмотреть файл

@ -25,11 +25,10 @@
#include "nsString.h"
#include "nsStubNotifier.h"
extern PRInt32 gInstallStatus;
nsStubNotifier::nsStubNotifier( pfnXPIStart aStart,
pfnXPIProgress aProgress,
pfnXPIFinal aFinal)
: m_start(aStart), m_progress(aProgress), m_final(aFinal)
nsStubNotifier::nsStubNotifier( pfnXPIProgress aProgress )
: m_progress(aProgress)
{
NS_INIT_ISUPPORTS();
}
@ -57,8 +56,7 @@ nsStubNotifier::AfterJavascriptEvaluation(const PRUnichar *URL)
NS_IMETHODIMP
nsStubNotifier::InstallStarted(const PRUnichar *URL, const PRUnichar* UIPackageName)
{
if (m_start)
m_start(nsCAutoString(URL), nsCAutoString(UIPackageName));
// we're not interested in this one
return NS_OK;
}
@ -81,9 +79,9 @@ nsStubNotifier::FinalizeProgress(const PRUnichar* message, PRInt32 itemNum, PRIn
NS_IMETHODIMP
nsStubNotifier::FinalStatus(const PRUnichar *URL, PRInt32 status)
{
if (m_final)
m_final( nsCAutoString(URL), status );
// if (m_final)
// m_final( nsCAutoString(URL), status );
gInstallStatus = status;
return NS_OK;
}

Просмотреть файл

@ -34,16 +34,14 @@ class nsStubNotifier : public nsIXPINotifier
{
public:
nsStubNotifier( pfnXPIStart, pfnXPIProgress, pfnXPIFinal );
nsStubNotifier( pfnXPIProgress );
virtual ~nsStubNotifier();
NS_DECL_ISUPPORTS
NS_DECL_NSIXPINOTIFIER
private:
pfnXPIStart m_start;
pfnXPIProgress m_progress;
pfnXPIFinal m_final;
};
#endif

Просмотреть файл

@ -62,6 +62,8 @@ static nsIServiceManager *gServiceMgr = 0;
static NS_DEFINE_IID(kSoftwareUpdateCID, NS_SoftwareUpdate_CID);
PRInt32 gInstallStatus;
//------------------------------------------------------------------------
@ -74,9 +76,7 @@ PR_PUBLIC_API(nsresult) XPI_Init(
#else
const char* aProgramDir,
#endif
pfnXPIStart startCB,
pfnXPIProgress progressCB,
pfnXPIFinal finalCB )
pfnXPIProgress progressCB )
{
nsresult rv;
nsCOMPtr<nsIFileSpec> nsIfsDirectory;
@ -154,7 +154,7 @@ PR_PUBLIC_API(nsresult) XPI_Init(
//--------------------------------------------------------------------
// Save the install wizard's callbacks as a nsIXPINotifer for later
//--------------------------------------------------------------------
nsStubNotifier* stub = new nsStubNotifier( startCB, progressCB, finalCB );
nsStubNotifier* stub = new nsStubNotifier( progressCB );
if (!stub)
{
gXPI->Release();
@ -190,7 +190,7 @@ PR_PUBLIC_API(void) XPI_Exit()
//------------------------------------------------------------------------
// XPI_Install()
//------------------------------------------------------------------------
PR_PUBLIC_API(nsresult) XPI_Install(
PR_PUBLIC_API(PRInt32) XPI_Install(
#ifdef XP_MAC
const FSSpec& aFile,
#else
@ -206,11 +206,13 @@ PR_PUBLIC_API(nsresult) XPI_Install(
nsFileURL URL(file);
nsString URLstr(URL.GetURLString());
gInstallStatus = -201; // nsInstall::UNEXPECTED_ERROR
NS_NewFileSpecWithSpec( file, getter_AddRefs(iFile) );
if (iFile && gXPI)
rv = gXPI->InstallJar( iFile, URLstr.GetUnicode(), args.GetUnicode(),
(aFlags | XPI_NO_NEW_THREAD), gNotifier );
return rv;
return gInstallStatus;
}

Просмотреть файл

@ -84,9 +84,7 @@ PR_EXTERN(nsresult) XPI_Init(
#else
const char* aProgramDir,
#endif
pfnXPIStart startCB,
pfnXPIProgress progressCB,
pfnXPIFinal finalCB );
pfnXPIProgress progressCB );
/** XPI_Install
*
@ -95,8 +93,10 @@ PR_EXTERN(nsresult) XPI_Init(
* @param file Native filename of XPI archive
* @param args Install.arguments, if any
* @param flags the old SmartUpdate trigger flags. This may go away
*
* @returns status Status from the installed archive
*/
PR_EXTERN(nsresult) XPI_Install(
PR_EXTERN(PRInt32) XPI_Install(
#ifdef XP_MAC
const FSSpec& file,
#else