mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 04:15:43 +00:00
Fixed Blamed Build Warnings
shrike Linux/i386 2.2.5 Clobber apprunner on 07/16 13:03
This commit is contained in:
parent
4ee45defd5
commit
37e9f5f89b
@ -335,23 +335,23 @@ void ReplaceScheduledFiles(void)
|
||||
/* replace files if any listed */
|
||||
if (REGERR_OK == NR_RegGetKey(reg, ROOTKEY_PRIVATE, REG_REPLACE_LIST_KEY, &key))
|
||||
{
|
||||
char tmpfile[MAXREGNAMELEN];
|
||||
char dummyFile[MAXREGNAMELEN];
|
||||
char target[MAXREGNAMELEN];
|
||||
|
||||
state = 0;
|
||||
while (REGERR_OK == NR_RegEnumEntries(reg, key, &state, tmpfile, sizeof(tmpfile), NULL ))
|
||||
while (REGERR_OK == NR_RegEnumEntries(reg, key, &state, dummyFile, sizeof(dummyFile), NULL ))
|
||||
{
|
||||
|
||||
nsFileSpec replaceFile(tmpfile);
|
||||
nsFileSpec replaceFile(dummyFile);
|
||||
|
||||
if (! replaceFile.Exists() )
|
||||
{
|
||||
NR_RegDeleteEntry( reg, key, tmpfile );
|
||||
NR_RegDeleteEntry( reg, key, dummyFile );
|
||||
}
|
||||
else if ( REGERR_OK != NR_RegGetEntryString( reg, key, tmpfile, target, sizeof(target) ) )
|
||||
else if ( REGERR_OK != NR_RegGetEntryString( reg, key, dummyFile, target, sizeof(target) ) )
|
||||
{
|
||||
/* can't read target filename, corruption? */
|
||||
NR_RegDeleteEntry( reg, key, tmpfile );
|
||||
NR_RegDeleteEntry( reg, key, dummyFile );
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -371,13 +371,13 @@ void ReplaceScheduledFiles(void)
|
||||
replaceFile.Rename(leafName);
|
||||
nsCRT::free(leafName);
|
||||
|
||||
NR_RegDeleteEntry( reg, key, tmpfile );
|
||||
NR_RegDeleteEntry( reg, key, dummyFile );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/* delete list node if empty */
|
||||
if (REGERR_NOMORE == NR_RegEnumEntries(reg, key, &state, tmpfile, sizeof(tmpfile), NULL ))
|
||||
if (REGERR_NOMORE == NR_RegEnumEntries(reg, key, &state, dummyFile, sizeof(dummyFile), NULL ))
|
||||
{
|
||||
NR_RegDeleteKey(reg, ROOTKEY_PRIVATE, REG_REPLACE_LIST_KEY);
|
||||
}
|
||||
|
@ -162,12 +162,13 @@ nsInstall::~nsInstall()
|
||||
delete mVersionInfo;
|
||||
}
|
||||
|
||||
|
||||
PRInt32
|
||||
nsInstall::SetScriptObject(void *aScriptObject)
|
||||
{
|
||||
mScriptObject = (JSObject*) aScriptObject;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef _WINDOWS
|
||||
nsInstall::SaveWinRegPrototype(void *aScriptObject)
|
||||
{
|
||||
@ -1616,7 +1617,6 @@ void
|
||||
nsInstall::CurrentUserNode(nsString& userRegNode)
|
||||
{
|
||||
char *profname;
|
||||
int len = MAXREGNAMELEN;
|
||||
nsIPref * prefs;
|
||||
|
||||
nsresult rv = nsServiceManager::GetService(kPrefsCID,
|
||||
|
@ -130,7 +130,9 @@ char* nsInstallDelete::toString()
|
||||
|
||||
if (mDeleteStatus == DELETE_COMPONENT)
|
||||
{
|
||||
sprintf( buffer, nsInstallResources::GetDeleteComponentString(), nsAutoCString(mRegistryName));
|
||||
char* temp = mRegistryName.ToNewCString();
|
||||
sprintf( buffer, nsInstallResources::GetDeleteComponentString(), temp);
|
||||
delete [] temp;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -68,7 +68,6 @@ nsInstallFile::nsInstallFile(nsInstall* inInstall,
|
||||
|
||||
/* Check for existence of the newer version */
|
||||
|
||||
PRBool versionNewer = PR_FALSE; // Is this a newer version
|
||||
char* qualifiedRegNameString = inComponentName.ToNewCString();
|
||||
|
||||
if ( (forceInstall == PR_FALSE ) && (inVInfo != "") && ( VR_ValidateComponent( qualifiedRegNameString ) == 0 ) )
|
||||
|
@ -964,13 +964,13 @@ InstallGetLastError(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval
|
||||
PR_STATIC_CALLBACK(JSBool)
|
||||
InstallGetWinProfile(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
nsInstall *nativeThis = (nsInstall*)JS_GetPrivate(cx, obj);
|
||||
nsAutoString b0;
|
||||
nsAutoString b1;
|
||||
|
||||
*rval = JSVAL_NULL;
|
||||
|
||||
#ifdef _WINDOWS
|
||||
nsInstall *nativeThis = (nsInstall*)JS_GetPrivate(cx, obj);
|
||||
nsAutoString b0;
|
||||
nsAutoString b1;
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if(nsnull == nativeThis)
|
||||
{
|
||||
@ -1007,11 +1007,13 @@ InstallGetWinProfile(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsva
|
||||
PR_STATIC_CALLBACK(JSBool)
|
||||
InstallGetWinRegistry(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
nsInstall *nativeThis = (nsInstall*)JS_GetPrivate(cx, obj);
|
||||
|
||||
*rval = JSVAL_NULL;
|
||||
|
||||
#ifdef _WINDOWS
|
||||
|
||||
nsInstall *nativeThis = (nsInstall*)JS_GetPrivate(cx, obj);
|
||||
JSBool rBool = JS_FALSE;
|
||||
|
||||
// If there's no private data, this must be the prototype, so ignore
|
||||
if(nsnull == nativeThis)
|
||||
{
|
||||
@ -2390,74 +2392,6 @@ static JSFunctionSpec InstallMethods[] =
|
||||
|
||||
|
||||
|
||||
#if 0
|
||||
//
|
||||
// Install constructor
|
||||
//
|
||||
PR_STATIC_CALLBACK(JSBool)
|
||||
Install(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
//
|
||||
// Install class initialization
|
||||
//
|
||||
|
||||
PRInt32 InitXPInstallObjects(nsIScriptContext *aContext, const char* jarfile, const char* args)
|
||||
{
|
||||
JSContext *jscontext = (JSContext *)aContext->GetNativeContext();
|
||||
JSObject *global = JS_GetGlobalObject(jscontext);
|
||||
JSObject *installObject = nsnull;
|
||||
JSObject *winRegPrototype = nsnull;
|
||||
JSObject *winProfilePrototype = nsnull;
|
||||
nsInstall *nativeInstallObject;
|
||||
|
||||
installObject = JS_InitClass( jscontext, // context
|
||||
global, // global object
|
||||
nsnull, // parent proto
|
||||
&InstallClass, // JSClass
|
||||
nsnull, // JSNative ctor
|
||||
0, // ctor args
|
||||
nsnull, // proto props
|
||||
nsnull, // proto funcs
|
||||
InstallProperties, // ctor props (static)
|
||||
InstallMethods); // ctor funcs (static)
|
||||
|
||||
if (nsnull == installObject)
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
if ( PR_FALSE == JS_DefineConstDoubles(jscontext, installObject, install_constants) )
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nativeInstallObject = new nsInstall();
|
||||
|
||||
nativeInstallObject->SetJarFileLocation(jarfile);
|
||||
nativeInstallObject->SetInstallArguments(args);
|
||||
|
||||
JS_SetPrivate(jscontext, installObject, nativeInstallObject);
|
||||
nativeInstallObject->SetScriptObject(installObject);
|
||||
|
||||
#ifdef _WINDOWS
|
||||
if(NS_OK != InitWinRegPrototype(jscontext, global, &winRegPrototype))
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
nativeInstallObject->SaveWinRegPrototype(winRegPrototype);
|
||||
|
||||
if(NS_OK != InitWinProfilePrototype(jscontext, global, &winRegPrototype))
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
nativeInstallObject->SaveWinProfilePrototype(winProfilePrototype);
|
||||
#endif
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
PRInt32 InitXPInstallObjects(JSContext *jscontext,
|
||||
@ -2467,6 +2401,8 @@ PRInt32 InitXPInstallObjects(JSContext *jscontext,
|
||||
const PRUnichar* args)
|
||||
{
|
||||
JSObject *installObject = nsnull;
|
||||
JSObject *winRegPrototype = nsnull;
|
||||
JSObject *winProfilePrototype = nsnull;
|
||||
nsInstall *nativeInstallObject;
|
||||
|
||||
installObject = JS_InitClass( jscontext, // context
|
||||
|
@ -109,7 +109,6 @@ PR_STATIC_CALLBACK(JSBool)
|
||||
InstallTriggerGlobalUpdateEnabled(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
nsIDOMInstallTriggerGlobal *nativeThis = (nsIDOMInstallTriggerGlobal*)JS_GetPrivate(cx, obj);
|
||||
JSBool rBool = JS_FALSE;
|
||||
PRBool nativeRet;
|
||||
|
||||
*rval = JSVAL_NULL;
|
||||
@ -254,7 +253,6 @@ PR_STATIC_CALLBACK(JSBool)
|
||||
InstallTriggerGlobalConditionalSoftwareUpdate(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
nsIDOMInstallTriggerGlobal *nativeThis = (nsIDOMInstallTriggerGlobal*)JS_GetPrivate(cx, obj);
|
||||
JSBool rBool = JS_FALSE;
|
||||
PRInt32 nativeRet;
|
||||
nsAutoString b0;
|
||||
nsAutoString b1;
|
||||
@ -409,7 +407,6 @@ PR_STATIC_CALLBACK(JSBool)
|
||||
InstallTriggerGlobalCompareVersion(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
nsIDOMInstallTriggerGlobal *nativeThis = (nsIDOMInstallTriggerGlobal*)JS_GetPrivate(cx, obj);
|
||||
JSBool rBool = JS_FALSE;
|
||||
PRInt32 nativeRet;
|
||||
nsAutoString b0;
|
||||
nsAutoString b1str;
|
||||
@ -586,7 +583,6 @@ nsresult NS_InitInstallTriggerGlobalClass(nsIScriptContext *aContext, void **aPr
|
||||
JSContext *jscontext = (JSContext *)aContext->GetNativeContext();
|
||||
JSObject *proto = nsnull;
|
||||
JSObject *constructor = nsnull;
|
||||
JSObject *parent_proto = nsnull;
|
||||
JSObject *global = JS_GetGlobalObject(jscontext);
|
||||
jsval vp;
|
||||
|
||||
|
@ -271,7 +271,6 @@ PR_STATIC_CALLBACK(JSBool)
|
||||
InstallVersionInit(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
nsIDOMInstallVersion *nativeThis = (nsIDOMInstallVersion*)JS_GetPrivate(cx, obj);
|
||||
JSBool rBool = JS_FALSE;
|
||||
nsAutoString b0;
|
||||
|
||||
*rval = JSVAL_NULL;
|
||||
@ -306,7 +305,6 @@ PR_STATIC_CALLBACK(JSBool)
|
||||
InstallVersionToString(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
nsIDOMInstallVersion *nativeThis = (nsIDOMInstallVersion*)JS_GetPrivate(cx, obj);
|
||||
JSBool rBool = JS_FALSE;
|
||||
nsAutoString nativeRet;
|
||||
|
||||
*rval = JSVAL_NULL;
|
||||
@ -340,7 +338,6 @@ PR_STATIC_CALLBACK(JSBool)
|
||||
InstallVersionCompareTo(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
nsIDOMInstallVersion *nativeThis = (nsIDOMInstallVersion*)JS_GetPrivate(cx, obj);
|
||||
JSBool rBool = JS_FALSE;
|
||||
PRInt32 nativeRet;
|
||||
nsString b0str;
|
||||
PRInt32 b0int;
|
||||
@ -573,7 +570,6 @@ nsresult NS_InitInstallVersionClass(nsIScriptContext *aContext, void **aPrototyp
|
||||
JSContext *jscontext = (JSContext *)aContext->GetNativeContext();
|
||||
JSObject *proto = nsnull;
|
||||
JSObject *constructor = nsnull;
|
||||
JSObject *parent_proto = nsnull;
|
||||
JSObject *global = JS_GetGlobalObject(jscontext);
|
||||
jsval vp;
|
||||
|
||||
|
@ -83,6 +83,20 @@ static NS_DEFINE_IID(kIInstallVersion_IID, NS_IDOMINSTALLVERSION_IID);
|
||||
static NS_DEFINE_IID(kInstallVersion_CID, NS_SoftwareUpdateInstallVersion_CID);
|
||||
|
||||
|
||||
nsSoftwareUpdate* nsSoftwareUpdate::mInstance = nsnull;
|
||||
|
||||
|
||||
nsSoftwareUpdate *
|
||||
nsSoftwareUpdate::GetInstance()
|
||||
{
|
||||
if (mInstance == NULL)
|
||||
{
|
||||
mInstance = new nsSoftwareUpdate();
|
||||
}
|
||||
return mInstance;
|
||||
}
|
||||
|
||||
|
||||
|
||||
nsSoftwareUpdate::nsSoftwareUpdate()
|
||||
{
|
||||
@ -293,7 +307,8 @@ nsSoftwareUpdate::InstallJar( nsIFileSpec* aLocalFile,
|
||||
NS_IMETHODIMP
|
||||
nsSoftwareUpdate::InstallJarCallBack()
|
||||
{
|
||||
PR_Lock(mLock);
|
||||
//PR_Lock(mLock); we are already lock by RunNextInstall().
|
||||
|
||||
nsInstallInfo *nextInstall = (nsInstallInfo*)mJarInstallQueue->Get(0);
|
||||
|
||||
if (nextInstall != nsnull)
|
||||
@ -302,7 +317,7 @@ nsSoftwareUpdate::InstallJarCallBack()
|
||||
mJarInstallQueue->Remove(0);
|
||||
|
||||
mInstalling = PR_FALSE;
|
||||
PR_Unlock(mLock);
|
||||
//PR_Unlock(mLock);
|
||||
|
||||
return RunNextInstall();
|
||||
|
||||
@ -358,6 +373,8 @@ nsSoftwareUpdateFactory::~nsSoftwareUpdateFactory(void)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
NS_IMPL_ISUPPORTS(nsSoftwareUpdateFactory,kIFactoryIID)
|
||||
|
||||
NS_IMETHODIMP
|
||||
@ -370,7 +387,7 @@ nsSoftwareUpdateFactory::CreateInstance(nsISupports *aOuter, REFNSIID aIID, void
|
||||
|
||||
*aResult = NULL;
|
||||
|
||||
nsSoftwareUpdate *inst = new nsSoftwareUpdate();
|
||||
nsSoftwareUpdate *inst = nsSoftwareUpdate::GetInstance();
|
||||
|
||||
if (inst == NULL)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
@ -24,7 +24,7 @@ class nsSoftwareUpdate: public nsIAppShellComponent, public nsISoftwareUpdate
|
||||
public:
|
||||
|
||||
NS_DEFINE_STATIC_CID_ACCESSOR( NS_SoftwareUpdate_CID );
|
||||
|
||||
static nsSoftwareUpdate *GetInstance();
|
||||
nsSoftwareUpdate();
|
||||
virtual ~nsSoftwareUpdate();
|
||||
|
||||
@ -45,7 +45,7 @@ class nsSoftwareUpdate: public nsIAppShellComponent, public nsISoftwareUpdate
|
||||
|
||||
|
||||
private:
|
||||
|
||||
static nsSoftwareUpdate* mInstance;
|
||||
nsresult RunNextInstall();
|
||||
nsresult DeleteScheduledNodes();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user