Fixing 31259. r=dveditz.
git-svn-id: svn://10.0.0.236/trunk@70114 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -1834,11 +1834,23 @@ nsInstall::FileOpFileGetDiskSpaceAvailable(nsInstallFolder& aTarget, PRInt64* aR
|
||||
|
||||
//nsIFileXXX: need to get nsIFile equivalent to GetModDate
|
||||
PRInt32
|
||||
nsInstall::FileOpFileGetModDate(nsInstallFolder& aTarget, nsFileSpec::TimeStamp* aReturn)
|
||||
nsInstall::FileOpFileGetModDate(nsInstallFolder& aTarget, double* aReturn)
|
||||
{
|
||||
//nsCOMPtr<nsIFile> localFile = aTarget.GetFileSpec();
|
||||
* aReturn = 0;
|
||||
|
||||
nsCOMPtr<nsIFile> localFile = aTarget.GetFileSpec();
|
||||
|
||||
if (localFile)
|
||||
{
|
||||
double newStamp;
|
||||
PRInt64 lastModDate = LL_ZERO;
|
||||
localFile->GetLastModificationDate(&lastModDate);
|
||||
|
||||
LL_L2D(newStamp, lastModDate);
|
||||
|
||||
*aReturn = newStamp;
|
||||
}
|
||||
|
||||
//localFile->GetModDate(*aReturn);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@@ -1871,12 +1883,22 @@ nsInstall::FileOpFileIsFile(nsInstallFolder& aTarget, PRBool* aReturn)
|
||||
|
||||
//nsIFileXXX: need to get the ModDateChanged equivalent for nsIFile
|
||||
PRInt32
|
||||
nsInstall::FileOpFileModDateChanged(nsInstallFolder& aTarget, nsFileSpec::TimeStamp& aOldStamp, PRBool* aReturn)
|
||||
nsInstall::FileOpFileModDateChanged(nsInstallFolder& aTarget, double aOldStamp, PRBool* aReturn)
|
||||
{
|
||||
//nsFileSpec* localFS = aTarget.GetFileSpec();
|
||||
*aReturn = PR_TRUE;
|
||||
|
||||
//*aReturn = localFS->ModDateChanged(aOldStamp);
|
||||
return NS_OK;
|
||||
nsCOMPtr<nsIFile> localFile = aTarget.GetFileSpec();
|
||||
if (localFile)
|
||||
{
|
||||
double newStamp;
|
||||
PRInt64 lastModDate = LL_ZERO;
|
||||
localFile->GetLastModificationDate(&lastModDate);
|
||||
|
||||
LL_L2D(newStamp, lastModDate);
|
||||
|
||||
*aReturn = !(newStamp == aOldStamp);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PRInt32
|
||||
|
||||
@@ -243,11 +243,11 @@ class nsInstall
|
||||
PRInt32 FileOpFileExecute(nsInstallFolder& aTarget, nsString& aParams, PRInt32* aReturn);
|
||||
PRInt32 FileOpFileGetNativeVersion(nsInstallFolder& aTarget, nsString* aReturn);
|
||||
PRInt32 FileOpFileGetDiskSpaceAvailable(nsInstallFolder& aTarget, PRInt64* aReturn);
|
||||
PRInt32 FileOpFileGetModDate(nsInstallFolder& aTarget, nsFileSpec::TimeStamp* aReturn);
|
||||
PRInt32 FileOpFileGetModDate(nsInstallFolder& aTarget, double* aReturn);
|
||||
PRInt32 FileOpFileGetSize(nsInstallFolder& aTarget, PRInt64* aReturn);
|
||||
PRInt32 FileOpFileIsDirectory(nsInstallFolder& aTarget, PRBool* aReturn);
|
||||
PRInt32 FileOpFileIsFile(nsInstallFolder& aTarget, PRBool* aReturn);
|
||||
PRInt32 FileOpFileModDateChanged(nsInstallFolder& aTarget, nsFileSpec::TimeStamp& aOldStamp, PRBool* aReturn);
|
||||
PRInt32 FileOpFileModDateChanged(nsInstallFolder& aTarget, double aOldStamp, PRBool* aReturn);
|
||||
PRInt32 FileOpFileMove(nsInstallFolder& aSrc, nsInstallFolder& aTarget, PRInt32* aReturn);
|
||||
PRInt32 FileOpFileRename(nsInstallFolder& aSrc, nsString& aTarget, PRInt32* aReturn);
|
||||
PRInt32 FileOpFileWindowsShortcut(nsIFile* aTarget, nsIFile* aShortcutPath, nsString& aDescription, nsIFile* aWorkingPath, nsString& aParams, nsIFile* aIcon, PRInt32 aIconId, PRInt32* aReturn);
|
||||
|
||||
@@ -611,7 +611,7 @@ JSBool PR_CALLBACK
|
||||
InstallFileOpFileGetModDate(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
nsInstall* nativeThis = (nsInstall*)JS_GetPrivate(cx, obj);
|
||||
PRUint32 nativeRet;
|
||||
double nativeRet;
|
||||
JSObject *jsObj;
|
||||
nsInstallFolder *folder;
|
||||
|
||||
@@ -646,18 +646,7 @@ InstallFileOpFileGetModDate(JSContext *cx, JSObject *obj, uintN argc, jsval *arg
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
if ( nativeRet <= JSVAL_INT_MAX )
|
||||
*rval = INT_TO_JSVAL(nativeRet);
|
||||
else
|
||||
{
|
||||
JSInt64 l;
|
||||
jsdouble d;
|
||||
|
||||
JSLL_UI2L( l, nativeRet );
|
||||
JSLL_L2D( d, l );
|
||||
|
||||
JS_NewDoubleValue( cx, d, rval );
|
||||
}
|
||||
JS_NewDoubleValue( cx, nativeRet, rval );
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
@@ -814,7 +803,6 @@ InstallFileOpFileModDateChanged(JSContext *cx, JSObject *obj, uintN argc, jsval
|
||||
{
|
||||
nsInstall* nativeThis = (nsInstall*)JS_GetPrivate(cx, obj);
|
||||
PRInt32 nativeRet;
|
||||
PRUint32 b1;
|
||||
JSObject *jsObj;
|
||||
nsInstallFolder *folder;
|
||||
|
||||
@@ -831,7 +819,7 @@ InstallFileOpFileModDateChanged(JSContext *cx, JSObject *obj, uintN argc, jsval
|
||||
// public int FileModDateChanged (nsInstallFolder aSourceFolder,
|
||||
// Number aOldDate);
|
||||
|
||||
b1 = JSVAL_TO_INT(argv[1]);
|
||||
jsdouble dval = *(JSVAL_TO_DOUBLE(argv[1]));
|
||||
if (argv[0] == JSVAL_NULL || !JSVAL_IS_OBJECT(argv[0])) //argv[0] MUST be a jsval
|
||||
{
|
||||
*rval = *rval = BOOLEAN_TO_JSVAL(PR_FALSE);
|
||||
@@ -848,7 +836,7 @@ InstallFileOpFileModDateChanged(JSContext *cx, JSObject *obj, uintN argc, jsval
|
||||
|
||||
folder = (nsInstallFolder*)JS_GetPrivate(cx, jsObj);
|
||||
|
||||
if(!folder || NS_OK != nativeThis->FileOpFileModDateChanged(*folder, b1, &nativeRet))
|
||||
if(!folder || NS_OK != nativeThis->FileOpFileModDateChanged(*folder, dval, &nativeRet))
|
||||
{
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user