From f020dcc1cda32a5d68402e28e2413be85324ffdb Mon Sep 17 00:00:00 2001 From: "pete%alphanumerica.com" Date: Tue, 24 Jul 2001 18:38:25 +0000 Subject: [PATCH] Fix for nsIFile delete conflicts with JS reserved name b=37406, r=dougt, sr=jst Renamed all Delete methods to Remove. --pete --- chrome/src/nsChromeRegistry.cpp | 4 ++-- embedding/browser/photon/src/WebBrowserContainer.cpp | 2 +- extensions/cookie/nsCookies.cpp | 2 +- extensions/cookie/nsPermissions.cpp | 2 +- mailnews/base/src/nsMessengerMigrator.cpp | 2 +- mailnews/compose/src/nsMsgCompFields.cpp | 2 +- mailnews/local/src/nsMovemailService.cpp | 4 ++-- modules/libjar/nsJAR.cpp | 2 +- modules/libpref/src/nsPrefService.cpp | 2 +- modules/plugin/base/src/nsPluginHostImpl.cpp | 6 +++--- modules/plugin/nglsrc/nsPluginHostImpl.cpp | 6 +++--- netwerk/cache/filecache/nsNetDiskCache.cpp | 6 +++--- netwerk/cache/src/nsDiskCacheDevice.cpp | 8 ++++---- netwerk/cache/src/nsDiskCacheMap.cpp | 2 +- netwerk/test/TestFileInput2.cpp | 2 +- profile/pref-migrator/src/nsPrefMigration.cpp | 4 ++-- profile/src/nsProfile.cpp | 2 +- profile/src/nsProfileAccess.cpp | 4 ++-- rdf/chrome/src/nsChromeRegistry.cpp | 4 ++-- rdf/datasource/src/nsLocalStore.cpp | 2 +- uriloader/exthandler/nsExternalHelperAppService.cpp | 6 +++--- xpcom/io/nsIFile.idl | 2 +- xpcom/io/nsLocalFileMac.cpp | 4 ++-- xpcom/io/nsLocalFileOS2.cpp | 4 ++-- xpcom/io/nsLocalFileUnix.cpp | 6 +++--- xpcom/io/nsLocalFileWin.cpp | 4 ++-- xpcom/reflect/xptinfo/src/xptiManifest.cpp | 2 +- xpcom/tests/nsIFileTest.cpp | 2 +- xpfe/components/history/src/nsGlobalHistory.cpp | 4 ++-- .../search/src/nsInternetSearchService.cpp | 4 ++-- xpinstall/src/ScheduledTasks.cpp | 4 ++-- xpinstall/src/nsInstallFile.cpp | 4 ++-- xpinstall/src/nsInstallFileOpItem.cpp | 12 ++++++------ xpinstall/src/nsInstallPatch.cpp | 8 ++++---- xpinstall/src/nsXPInstallManager.cpp | 4 ++-- 35 files changed, 69 insertions(+), 69 deletions(-) diff --git a/chrome/src/nsChromeRegistry.cpp b/chrome/src/nsChromeRegistry.cpp index 2bc277136b90..32883dd37131 100644 --- a/chrome/src/nsChromeRegistry.cpp +++ b/chrome/src/nsChromeRegistry.cpp @@ -3038,7 +3038,7 @@ nsChromeRegistry::CheckForNewChrome() } } PR_Close(file); - // listFile->Delete(PR_FALSE); + // listFile->Remove(PR_FALSE); return rv; } @@ -3223,7 +3223,7 @@ NS_IMETHODIMP nsChromeRegistry::Observe(nsISupports *aSubject, const PRUnichar * nsCOMPtr userChromeDir; rv = NS_GetSpecialDirectory(NS_APP_USER_CHROME_DIR, getter_AddRefs(userChromeDir)); if (NS_SUCCEEDED(rv) && userChromeDir) - rv = userChromeDir->Delete(PR_TRUE); + rv = userChromeDir->Remove(PR_TRUE); } } else if (!nsCRT::strcmp(NS_LITERAL_STRING("profile-do-change").get(), aTopic)) { diff --git a/embedding/browser/photon/src/WebBrowserContainer.cpp b/embedding/browser/photon/src/WebBrowserContainer.cpp index 0713c864138d..b899f8370c22 100644 --- a/embedding/browser/photon/src/WebBrowserContainer.cpp +++ b/embedding/browser/photon/src/WebBrowserContainer.cpp @@ -455,7 +455,7 @@ NS_IMETHODIMP CWebBrowserContainer::OnStateChange(nsIWebProgress* aWebProgress, fileToUse->Equals( tempFile, &equalToTempFile ); fileToUse->Exists(&filetoUseAlreadyExists); if( filetoUseAlreadyExists && !equalToTempFile ) - fileToUse->Delete(PR_FALSE); + fileToUse->Remove(PR_FALSE); // extract the new leaf name from the file location nsXPIDLCString fileName; diff --git a/extensions/cookie/nsCookies.cpp b/extensions/cookie/nsCookies.cpp index 5cbd41530685..3df462ae7d90 100644 --- a/extensions/cookie/nsCookies.cpp +++ b/extensions/cookie/nsCookies.cpp @@ -132,7 +132,7 @@ COOKIE_DeletePersistentUserData(void) if (NS_SUCCEEDED(res)) { res = cookiesFile->Append(kCookiesFileName); if (NS_SUCCEEDED(res)) - (void) cookiesFile->Delete(PR_FALSE); + (void) cookiesFile->Remove(PR_FALSE); } } diff --git a/extensions/cookie/nsPermissions.cpp b/extensions/cookie/nsPermissions.cpp index 972f490344ea..be73a1ecc6ca 100644 --- a/extensions/cookie/nsPermissions.cpp +++ b/extensions/cookie/nsPermissions.cpp @@ -662,7 +662,7 @@ PERMISSION_DeletePersistentUserData(void) if (NS_SUCCEEDED(res)) { res = cookiesPermFile->Append(kCookiesPermFileName); if (NS_SUCCEEDED(res)) - (void) cookiesPermFile->Delete(PR_FALSE); + (void) cookiesPermFile->Remove(PR_FALSE); } } diff --git a/mailnews/base/src/nsMessengerMigrator.cpp b/mailnews/base/src/nsMessengerMigrator.cpp index a855bb222313..8a39a28d3ee2 100644 --- a/mailnews/base/src/nsMessengerMigrator.cpp +++ b/mailnews/base/src/nsMessengerMigrator.cpp @@ -1960,7 +1960,7 @@ nsMessengerMigrator::migrateAddressBookPrefEnum(const char *aPref, void *aClosur #ifdef DEBUG_AB_MIGRATION printf("remove the tmp file\n"); #endif /* DEBUG_AB_MIGRATION */ - rv = tmpLDIFFile->Delete(PR_TRUE); + rv = tmpLDIFFile->Remove(PR_TRUE); NS_ASSERTION(NS_SUCCEEDED(rv),"failed to delete the temp ldif file"); if (NS_FAILED(rv)) return; diff --git a/mailnews/compose/src/nsMsgCompFields.cpp b/mailnews/compose/src/nsMsgCompFields.cpp index cd554c176af8..c64633118037 100644 --- a/mailnews/compose/src/nsMsgCompFields.cpp +++ b/mailnews/compose/src/nsMsgCompFields.cpp @@ -157,7 +157,7 @@ nsresult nsMsgCompFields::CleanUpTempFiles() } // remove it if not a dir - urlFile->Delete(PR_FALSE); + urlFile->Remove(PR_FALSE); } token = nsCRT::strtok(rest, ",", &rest); diff --git a/mailnews/local/src/nsMovemailService.cpp b/mailnews/local/src/nsMovemailService.cpp index 20b6771e2091..aa16c4bc383a 100644 --- a/mailnews/local/src/nsMovemailService.cpp +++ b/mailnews/local/src/nsMovemailService.cpp @@ -180,7 +180,7 @@ PRBool ObtainSpoolLock(const char *spoolnameStr, #endif // step 3: remove .mozlock file, in any case - rv = tmplocfile->Delete(PR_FALSE /* non-recursive */); + rv = tmplocfile->Remove(PR_FALSE /* non-recursive */); #ifdef MOVEMAIL_DEBUG if (NS_FAILED(rv)) { // Could not delete our .mozlock file... very unusual, but @@ -225,7 +225,7 @@ PRBool YieldSpoolLock(const char *spoolnameStr) return PR_FALSE; // Delete the file - rv = locklocfile->Delete(PR_FALSE /* non-recursive */); + rv = locklocfile->Remove(PR_FALSE /* non-recursive */); if (NS_FAILED(rv)) return PR_FALSE; diff --git a/modules/libjar/nsJAR.cpp b/modules/libjar/nsJAR.cpp index 83f61aee7164..39bedaf94b02 100644 --- a/modules/libjar/nsJAR.cpp +++ b/modules/libjar/nsJAR.cpp @@ -270,7 +270,7 @@ nsJAR::Extract(const char *zipEntry, nsIFile* outFile) PR_Close(fd); if (err != ZIP_OK) - outFile->Delete(PR_FALSE); + outFile->Remove(PR_FALSE); else { #if defined(XP_UNIX) diff --git a/modules/libpref/src/nsPrefService.cpp b/modules/libpref/src/nsPrefService.cpp index 7009c22f16e3..95058da088d9 100644 --- a/modules/libpref/src/nsPrefService.cpp +++ b/modules/libpref/src/nsPrefService.cpp @@ -133,7 +133,7 @@ NS_IMETHODIMP nsPrefService::Observe(nsISupports *aSubject, const PRUnichar *aTo if (!nsCRT::strcmp(aTopic, NS_LITERAL_STRING("profile-before-change").get())) { if (!nsCRT::strcmp(someData, NS_LITERAL_STRING("shutdown-cleanse").get())) { if (mCurrentFile) { - mCurrentFile->Delete(PR_FALSE); + mCurrentFile->Remove(PR_FALSE); NS_RELEASE(mCurrentFile); } } else { diff --git a/modules/plugin/base/src/nsPluginHostImpl.cpp b/modules/plugin/base/src/nsPluginHostImpl.cpp index e1055f874943..f851c7ebbce4 100644 --- a/modules/plugin/base/src/nsPluginHostImpl.cpp +++ b/modules/plugin/base/src/nsPluginHostImpl.cpp @@ -1088,7 +1088,7 @@ nsPluginStreamInfo::~nsPluginStreamInfo() PR_FALSE, getter_AddRefs(localFile)); if(NS_SUCCEEDED(res)) - localFile->Delete(PR_FALSE); + localFile->Remove(PR_FALSE); } if (mFilePath) PL_strfree(mFilePath); @@ -1455,7 +1455,7 @@ nsPluginStreamListenerPeer::~nsPluginStreamListenerPeer() nsCOMPtr localFile; nsresult res = NS_NewLocalFile(mLocalFile, PR_FALSE, getter_AddRefs(localFile)); if(NS_SUCCEEDED(res)) - localFile->Delete(PR_FALSE); + localFile->Remove(PR_FALSE); delete [] mLocalFile; } delete mDataForwardToRequest; @@ -2806,7 +2806,7 @@ NS_IMETHODIMP nsPluginHostImpl::Destroy(void) rv = pluginTmp->Append(kPluginTmpDirName); if (NS_FAILED(rv)) return rv; - pluginTmp->Delete(PR_TRUE); + pluginTmp->Remove(PR_TRUE); return NS_OK; } diff --git a/modules/plugin/nglsrc/nsPluginHostImpl.cpp b/modules/plugin/nglsrc/nsPluginHostImpl.cpp index e1055f874943..f851c7ebbce4 100644 --- a/modules/plugin/nglsrc/nsPluginHostImpl.cpp +++ b/modules/plugin/nglsrc/nsPluginHostImpl.cpp @@ -1088,7 +1088,7 @@ nsPluginStreamInfo::~nsPluginStreamInfo() PR_FALSE, getter_AddRefs(localFile)); if(NS_SUCCEEDED(res)) - localFile->Delete(PR_FALSE); + localFile->Remove(PR_FALSE); } if (mFilePath) PL_strfree(mFilePath); @@ -1455,7 +1455,7 @@ nsPluginStreamListenerPeer::~nsPluginStreamListenerPeer() nsCOMPtr localFile; nsresult res = NS_NewLocalFile(mLocalFile, PR_FALSE, getter_AddRefs(localFile)); if(NS_SUCCEEDED(res)) - localFile->Delete(PR_FALSE); + localFile->Remove(PR_FALSE); delete [] mLocalFile; } delete mDataForwardToRequest; @@ -2806,7 +2806,7 @@ NS_IMETHODIMP nsPluginHostImpl::Destroy(void) rv = pluginTmp->Append(kPluginTmpDirName); if (NS_FAILED(rv)) return rv; - pluginTmp->Delete(PR_TRUE); + pluginTmp->Remove(PR_TRUE); return NS_OK; } diff --git a/netwerk/cache/filecache/nsNetDiskCache.cpp b/netwerk/cache/filecache/nsNetDiskCache.cpp index e60e1e1b37c2..3ec7a24271b5 100644 --- a/netwerk/cache/filecache/nsNetDiskCache.cpp +++ b/netwerk/cache/filecache/nsNetDiskCache.cpp @@ -170,7 +170,7 @@ nsNetDiskCache::~nsNetDiskCache() if( trash.CompareWithConversion( filename, PR_FALSE, 5 ) == 0) - file->Delete( PR_TRUE ); + file->Remove( PR_TRUE ); nsCRT::free(filename) ; } @@ -642,12 +642,12 @@ nsNetDiskCache::RemoveAll(void) return rv ; PRBool isDirectory; if ( NS_SUCCEEDED(file->IsDirectory( &isDirectory )) && isDirectory ) - file->Delete( PR_TRUE ); + file->Remove( PR_TRUE ); } if ( mDBFile ) { - mDBFile->Delete(PR_FALSE) ; + mDBFile->Remove(PR_FALSE) ; if (mDBFile) { PRBool exists = PR_FALSE; diff --git a/netwerk/cache/src/nsDiskCacheDevice.cpp b/netwerk/cache/src/nsDiskCacheDevice.cpp index 622d48064bdb..d22461b9c21a 100644 --- a/netwerk/cache/src/nsDiskCacheDevice.cpp +++ b/netwerk/cache/src/nsDiskCacheDevice.cpp @@ -287,7 +287,7 @@ nsDiskCacheDevice::Init() nsCOMPtr cacheTrashDir; rv = GetCacheTrashDirectory(getter_AddRefs(cacheTrashDir)); if (NS_FAILED(rv)) goto error_exit; - (void) cacheTrashDir->Delete(PR_TRUE); // ignore errors, we tried... + (void) cacheTrashDir->Remove(PR_TRUE); // ignore errors, we tried... // Try opening cache map file. mCacheMap = new nsDiskCacheMap; @@ -730,7 +730,7 @@ nsDiskCacheDevice::InitializeCacheDirectory() nsresult rv; // recursively delete the disk cache directory. - rv = mCacheDirectory->Delete(PR_TRUE); + rv = mCacheDirectory->Remove(PR_TRUE); if (NS_FAILED(rv)) { // try moving it aside @@ -850,7 +850,7 @@ nsDiskCacheDevice::SetCacheParentDirectory(nsILocalFile * parentDir) rv = directory->Exists(&exists); if (NS_SUCCEEDED(rv) && exists) - (void) directory->Delete(PR_TRUE); + (void) directory->Remove(PR_TRUE); // clean up obsolete NewCache directory rv = parentDir->Clone(getter_AddRefs(directory)); @@ -860,7 +860,7 @@ nsDiskCacheDevice::SetCacheParentDirectory(nsILocalFile * parentDir) rv = directory->Exists(&exists); if (NS_SUCCEEDED(rv) && exists) - (void) directory->Delete(PR_TRUE); + (void) directory->Remove(PR_TRUE); } diff --git a/netwerk/cache/src/nsDiskCacheMap.cpp b/netwerk/cache/src/nsDiskCacheMap.cpp index c27e5603003e..06fda7d34ff2 100644 --- a/netwerk/cache/src/nsDiskCacheMap.cpp +++ b/netwerk/cache/src/nsDiskCacheMap.cpp @@ -759,7 +759,7 @@ nsDiskCacheMap::DeleteStorage(nsDiskCacheRecord * record, PRBool metaData) rv = GetFileForDiskCacheRecord(record, metaData, getter_AddRefs(file)); if (NS_SUCCEEDED(rv)) { - rv = file->Delete(PR_FALSE); // false == non-recursive + rv = file->Remove(PR_FALSE); // false == non-recursive } DecrementTotalSize(sizeK * 1024); diff --git a/netwerk/test/TestFileInput2.cpp b/netwerk/test/TestFileInput2.cpp index 3bef0c17f869..2eb749f7f4a5 100644 --- a/netwerk/test/TestFileInput2.cpp +++ b/netwerk/test/TestFileInput2.cpp @@ -385,7 +385,7 @@ Test(CreateFun create, PRUint32 count, if (NS_FAILED(rv)) goto done; if (exists) { - rv = outSpec->Delete(PR_FALSE); + rv = outSpec->Remove(PR_FALSE); if (NS_FAILED(rv)) goto done; } diff --git a/profile/pref-migrator/src/nsPrefMigration.cpp b/profile/pref-migrator/src/nsPrefMigration.cpp index 2bf7c61d97e7..37bce7ae8293 100644 --- a/profile/pref-migrator/src/nsPrefMigration.cpp +++ b/profile/pref-migrator/src/nsPrefMigration.cpp @@ -1128,11 +1128,11 @@ nsPrefMigration::ProcessPrefsCallback(const char* oldProfilePathStr, const char PRBool flagExists = PR_FALSE; m_prefsFile->Exists(&flagExists); //Delete the prefs.js file in the temp directory. if (flagExists) - m_prefsFile->Delete(PR_FALSE); + m_prefsFile->Remove(PR_FALSE); systemTempIFileDir->Exists(&flagExists); //Delete the unique dir in the system temp dir. if (flagExists) - systemTempIFileDir->Delete(PR_FALSE); + systemTempIFileDir->Remove(PR_FALSE); return rv; } diff --git a/profile/src/nsProfile.cpp b/profile/src/nsProfile.cpp index d3063a88e1b2..359c73b7fa1c 100644 --- a/profile/src/nsProfile.cpp +++ b/profile/src/nsProfile.cpp @@ -1667,7 +1667,7 @@ NS_IMETHODIMP nsProfile::DeleteProfile(const PRUnichar* profileName, PRBool canD if (NS_SUCCEEDED(rv)) dirToDelete = parentDir; } - rv = dirToDelete->Delete(PR_TRUE); + rv = dirToDelete->Remove(PR_TRUE); } } diff --git a/profile/src/nsProfileAccess.cpp b/profile/src/nsProfileAccess.cpp index aa7fd79ecb1a..04956a6b2571 100644 --- a/profile/src/nsProfileAccess.cpp +++ b/profile/src/nsProfileAccess.cpp @@ -1358,7 +1358,7 @@ nsresult ProfileStruct::InternalizeLocation(nsIRegistry *aRegistry, nsRegistryKe { SetResolvedProfileDir(tempLocal); if (leafCreated) - tempLocal->Delete(PR_FALSE); + tempLocal->Remove(PR_FALSE); } } @@ -1383,7 +1383,7 @@ nsresult ProfileStruct::ExternalizeLocation(nsIRegistry *aRegistry, nsRegistryKe rv = resolvedLocation->GetPersistentDescriptor(getter_Copies(descBuf)); if (NS_FAILED(rv)) return rv; if (leafCreated) - resolvedLocation->Delete(PR_FALSE); + resolvedLocation->Remove(PR_FALSE); regData = NS_ConvertUTF8toUCS2(descBuf); #else nsXPIDLString ucPath; diff --git a/rdf/chrome/src/nsChromeRegistry.cpp b/rdf/chrome/src/nsChromeRegistry.cpp index 2bc277136b90..32883dd37131 100644 --- a/rdf/chrome/src/nsChromeRegistry.cpp +++ b/rdf/chrome/src/nsChromeRegistry.cpp @@ -3038,7 +3038,7 @@ nsChromeRegistry::CheckForNewChrome() } } PR_Close(file); - // listFile->Delete(PR_FALSE); + // listFile->Remove(PR_FALSE); return rv; } @@ -3223,7 +3223,7 @@ NS_IMETHODIMP nsChromeRegistry::Observe(nsISupports *aSubject, const PRUnichar * nsCOMPtr userChromeDir; rv = NS_GetSpecialDirectory(NS_APP_USER_CHROME_DIR, getter_AddRefs(userChromeDir)); if (NS_SUCCEEDED(rv) && userChromeDir) - rv = userChromeDir->Delete(PR_TRUE); + rv = userChromeDir->Remove(PR_TRUE); } } else if (!nsCRT::strcmp(NS_LITERAL_STRING("profile-do-change").get(), aTopic)) { diff --git a/rdf/datasource/src/nsLocalStore.cpp b/rdf/datasource/src/nsLocalStore.cpp index 8cbb45208e62..c5621d16c8f1 100644 --- a/rdf/datasource/src/nsLocalStore.cpp +++ b/rdf/datasource/src/nsLocalStore.cpp @@ -488,7 +488,7 @@ LocalStoreImpl::Observe(nsISupports *aSubject, const PRUnichar *aTopic, const PR nsCOMPtr aFile; rv = NS_GetSpecialDirectory(NS_APP_LOCALSTORE_50_FILE, getter_AddRefs(aFile)); if (NS_SUCCEEDED(rv)) - rv = aFile->Delete(PR_FALSE); + rv = aFile->Remove(PR_FALSE); } } else if (!nsCRT::strcmp(aTopic, NS_LITERAL_STRING("profile-do-change").get())) { diff --git a/uriloader/exthandler/nsExternalHelperAppService.cpp b/uriloader/exthandler/nsExternalHelperAppService.cpp index f5d875bb1595..0a8472276ceb 100644 --- a/uriloader/exthandler/nsExternalHelperAppService.cpp +++ b/uriloader/exthandler/nsExternalHelperAppService.cpp @@ -563,7 +563,7 @@ nsresult nsExternalHelperAppService::ExpungeTemporaryFiles() { localFile = do_QueryInterface(element); if (localFile) - localFile->Delete(PR_FALSE); + localFile->Remove(PR_FALSE); } } @@ -1107,7 +1107,7 @@ nsresult nsExternalAppHandler::MoveFile(nsIFile * aNewFileLocation) fileToUse->Equals(mTempFile, &equalToTempFile); fileToUse->Exists(&filetoUseAlreadyExists); if (filetoUseAlreadyExists && !equalToTempFile) - fileToUse->Delete(PR_FALSE); + fileToUse->Remove(PR_FALSE); // extract the new leaf name from the file location nsXPIDLCString fileName; @@ -1243,7 +1243,7 @@ NS_IMETHODIMP nsExternalAppHandler::Cancel() // clean up after ourselves and delete the temp file... if (mTempFile) { - mTempFile->Delete(PR_TRUE); + mTempFile->Remove(PR_TRUE); mTempFile = nsnull; } diff --git a/xpcom/io/nsIFile.idl b/xpcom/io/nsIFile.idl index 06fcc2b67334..cd33061feefa 100644 --- a/xpcom/io/nsIFile.idl +++ b/xpcom/io/nsIFile.idl @@ -172,7 +172,7 @@ interface nsIFile : nsISupports * * This will not resolve any symlinks. */ - void delete(in boolean recursive); + void remove(in boolean recursive); /** * Attributes of nsIFile. diff --git a/xpcom/io/nsLocalFileMac.cpp b/xpcom/io/nsLocalFileMac.cpp index 6a4c40d54099..15ec778e2e11 100644 --- a/xpcom/io/nsLocalFileMac.cpp +++ b/xpcom/io/nsLocalFileMac.cpp @@ -1504,7 +1504,7 @@ nsresult nsLocalFile::MoveCopy( nsIFile* newParentDir, const char* newName, PRBo rv = CopyTo( newParentDir, newName ); if ( NS_FAILED ( rv ) ) return rv; - return Delete( PR_TRUE ); + return Remove( PR_TRUE ); } } return MacErrorMapper( macErr ); @@ -1588,7 +1588,7 @@ nsLocalFile::Load(PRLibrary * *_retval) } NS_IMETHODIMP -nsLocalFile::Delete(PRBool recursive) +nsLocalFile::Remove(PRBool recursive) { MakeDirty(); diff --git a/xpcom/io/nsLocalFileOS2.cpp b/xpcom/io/nsLocalFileOS2.cpp index 529eeceeeeb1..a76426309c1c 100644 --- a/xpcom/io/nsLocalFileOS2.cpp +++ b/xpcom/io/nsLocalFileOS2.cpp @@ -1265,7 +1265,7 @@ nsLocalFile::Load(PRLibrary * *_retval) } NS_IMETHODIMP -nsLocalFile::Delete(PRBool recursive) +nsLocalFile::Remove(PRBool recursive) { PRBool isDir; @@ -1296,7 +1296,7 @@ nsLocalFile::Delete(PRBool recursive) iterator->GetNext(getter_AddRefs(item)); file = do_QueryInterface(item); - file->Delete(recursive); + file->Remove(recursive); iterator->HasMoreElements(&more); } diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp index 98e2c602504a..c4faae7a7d51 100644 --- a/xpcom/io/nsLocalFileUnix.cpp +++ b/xpcom/io/nsLocalFileUnix.cpp @@ -753,7 +753,7 @@ nsLocalFile::MoveTo(nsIFile *newParent, const char *newName) #endif rv = CopyTo(newParent, newName); if (NS_SUCCEEDED(rv)) - rv = Delete(PR_TRUE); + rv = Remove(PR_TRUE); } else { rv = NSRESULT_FOR_ERRNO(); } @@ -762,7 +762,7 @@ nsLocalFile::MoveTo(nsIFile *newParent, const char *newName) } NS_IMETHODIMP -nsLocalFile::Delete(PRBool recursive) +nsLocalFile::Remove(PRBool recursive) { CHECK_mPath(); @@ -795,7 +795,7 @@ nsLocalFile::Delete(PRBool recursive) nsCOMPtr file = do_QueryInterface(item, &rv); if (NS_FAILED(rv)) return NS_ERROR_FAILURE; - if (NS_FAILED(rv = file->Delete(recursive))) + if (NS_FAILED(rv = file->Remove(recursive))) return rv; } } diff --git a/xpcom/io/nsLocalFileWin.cpp b/xpcom/io/nsLocalFileWin.cpp index bfefbbbda5a8..85eda58610d0 100644 --- a/xpcom/io/nsLocalFileWin.cpp +++ b/xpcom/io/nsLocalFileWin.cpp @@ -1159,7 +1159,7 @@ nsLocalFile::Load(PRLibrary * *_retval) } NS_IMETHODIMP -nsLocalFile::Delete(PRBool recursive) +nsLocalFile::Remove(PRBool recursive) { PRBool isDir; @@ -1190,7 +1190,7 @@ nsLocalFile::Delete(PRBool recursive) iterator->GetNext(getter_AddRefs(item)); file = do_QueryInterface(item); - file->Delete(recursive); + file->Remove(recursive); iterator->HasMoreElements(&more); } diff --git a/xpcom/reflect/xptinfo/src/xptiManifest.cpp b/xpcom/reflect/xptinfo/src/xptiManifest.cpp index 4537c820417f..ab97c62c95b5 100644 --- a/xpcom/reflect/xptinfo/src/xptiManifest.cpp +++ b/xpcom/reflect/xptinfo/src/xptiManifest.cpp @@ -186,7 +186,7 @@ out: if(NS_FAILED(mainFile->Exists(&exists))) return PR_FALSE; - if(exists && NS_FAILED(mainFile->Delete(PR_FALSE))) + if(exists && NS_FAILED(mainFile->Remove(PR_FALSE))) return PR_FALSE; // XXX Would prefer MoveTo with a 'null' newdir, the but nsILocalFile diff --git a/xpcom/tests/nsIFileTest.cpp b/xpcom/tests/nsIFileTest.cpp index 292a16d94c0c..4bbc3b600b35 100644 --- a/xpcom/tests/nsIFileTest.cpp +++ b/xpcom/tests/nsIFileTest.cpp @@ -301,7 +301,7 @@ DeletionTest(char* creationPath, char* appendPath, PRBool recursive) else printf("no.\n"); - rv = file->Delete(recursive); + rv = file->Remove(recursive); VerifyResult(rv); rv = file->Exists(&exists); diff --git a/xpfe/components/history/src/nsGlobalHistory.cpp b/xpfe/components/history/src/nsGlobalHistory.cpp index 09414e4d2c4f..739481139eb3 100644 --- a/xpfe/components/history/src/nsGlobalHistory.cpp +++ b/xpfe/components/history/src/nsGlobalHistory.cpp @@ -2151,7 +2151,7 @@ nsGlobalHistory::OpenDB() // we couldn't open the file, so it's either corrupt or doesn't exist. // attempt to delete the file, but ignore the error - historyFile->Delete(PR_FALSE); + historyFile->Remove(PR_FALSE); rv = OpenNewFile(factory, filePath); } @@ -3163,7 +3163,7 @@ nsGlobalHistory::Observe(nsISupports *aSubject, const PRUnichar *aTopic, nsCOMPtr historyFile; rv = NS_GetSpecialDirectory(NS_APP_HISTORY_50_FILE, getter_AddRefs(historyFile)); if (NS_SUCCEEDED(rv)) - rv = historyFile->Delete(PR_FALSE); + rv = historyFile->Remove(PR_FALSE); } } else if (aTopicString.Equals(NS_LITERAL_STRING("profile-do-change"))) diff --git a/xpfe/components/search/src/nsInternetSearchService.cpp b/xpfe/components/search/src/nsInternetSearchService.cpp index c28b642e178b..450c60ef8428 100755 --- a/xpfe/components/search/src/nsInternetSearchService.cpp +++ b/xpfe/components/search/src/nsInternetSearchService.cpp @@ -2318,7 +2318,7 @@ InternetSearchDataSource::saveContents(nsIChannel* channel, nsIInternetSearchCon // save data to file // Note: write out one character at a time, as we might be dealing // with binary data (such as 0x00) [especially for images] - outFile->Delete(PR_FALSE); + outFile->Remove(PR_FALSE); // Make an nsFileSpec from file so we can use nsOutputFileStream nsXPIDLCString pathBuf; @@ -5745,7 +5745,7 @@ InternetSearchDataSource::Observe(nsISupports *aSubject, const PRUnichar *aTopic nsCOMPtr searchFile; rv = NS_GetSpecialDirectory(NS_APP_SEARCH_50_FILE, getter_AddRefs(searchFile)); if (NS_SUCCEEDED(rv)) - rv = searchFile->Delete(PR_FALSE); + rv = searchFile->Remove(PR_FALSE); } } else if (!nsCRT::strcmp(aTopic, NS_LITERAL_STRING("profile-do-change").get())) diff --git a/xpinstall/src/ScheduledTasks.cpp b/xpinstall/src/ScheduledTasks.cpp index 4b9fd559705c..f4df4f747f4b 100644 --- a/xpinstall/src/ScheduledTasks.cpp +++ b/xpinstall/src/ScheduledTasks.cpp @@ -171,7 +171,7 @@ PRInt32 DeleteFileNowOrSchedule(nsIFile* filename) PRBool flagExists; PRInt32 result = nsInstall::SUCCESS; - filename->Delete(PR_FALSE); + filename->Remove(PR_FALSE); filename->Exists(&flagExists); if (flagExists) result = ScheduleFileForDeletion(filename); @@ -472,7 +472,7 @@ void DeleteScheduledFiles( HREG reg ) if (NS_SUCCEEDED(rv)) { PRBool flagExists; - doomedFile->Delete(PR_FALSE); + doomedFile->Remove(PR_FALSE); doomedFile->Exists(&flagExists); if ( !flagExists ) { diff --git a/xpinstall/src/nsInstallFile.cpp b/xpinstall/src/nsInstallFile.cpp index 4d5cd30c3a34..10ba7055289d 100644 --- a/xpinstall/src/nsInstallFile.cpp +++ b/xpinstall/src/nsInstallFile.cpp @@ -237,7 +237,7 @@ void nsInstallFile::RemoveAllFolders() mFinalFile->GetParent(nsfsFolder); for(i = 0; i < mFolderCreateCount; i++) { - nsfsFolder.Delete(PR_FALSE); + nsfsFolder.Remove(PR_FALSE); nsfsFolder.GetParent(nsfsParentFolder); nsfsFolder = nsfsParentFolder; } @@ -308,7 +308,7 @@ PRInt32 nsInstallFile::Complete() void nsInstallFile::Abort() { if (mExtractedFile != nsnull) - mExtractedFile->Delete(PR_FALSE); + mExtractedFile->Remove(PR_FALSE); } #define RESBUFSIZE 4096 diff --git a/xpinstall/src/nsInstallFileOpItem.cpp b/xpinstall/src/nsInstallFileOpItem.cpp index 5f66255a207f..236a99c81f29 100644 --- a/xpinstall/src/nsInstallFileOpItem.cpp +++ b/xpinstall/src/nsInstallFileOpItem.cpp @@ -588,7 +588,7 @@ PRInt32 nsInstallFileOpItem::NativeFileOpDirCreateAbort() { if(nsInstallFileOpItem::ACTION_SUCCESS == mAction) - mTarget->Delete(PR_FALSE); + mTarget->Remove(PR_FALSE); return nsInstall::SUCCESS; } @@ -615,7 +615,7 @@ nsInstallFileOpItem::NativeFileOpDirRemovePrepare() PRInt32 nsInstallFileOpItem::NativeFileOpDirRemoveComplete() { - mTarget->Delete(mFlags); + mTarget->Remove(mFlags); return nsInstall::SUCCESS; } @@ -826,7 +826,7 @@ nsInstallFileOpItem::NativeFileOpFileCopyComplete() mTarget->IsFile(&flagIsFile); //Target is file that is already on the system if (flagIsFile) { - rv = mTarget->Delete(PR_FALSE); + rv = mTarget->Remove(PR_FALSE); if (NS_FAILED(rv)) return rv; rv = mTarget->GetParent(getter_AddRefs(parent)); if (NS_FAILED(rv)) return rv; @@ -844,7 +844,7 @@ nsInstallFileOpItem::NativeFileOpFileCopyComplete() if (NS_FAILED(rv)) return rv; tempTarget->Exists(&flagExists); if (flagExists) - tempTarget->Delete(PR_FALSE); + tempTarget->Remove(PR_FALSE); rv = mSrc->CopyTo(mTarget, leafName); } @@ -876,7 +876,7 @@ nsInstallFileOpItem::NativeFileOpFileCopyAbort() char* leafName; mSrc->GetLeafName(&leafName); fullTarget->Append(leafName); - fullTarget->Delete(PR_FALSE); + fullTarget->Remove(PR_FALSE); } return ret; @@ -1236,7 +1236,7 @@ nsInstallFileOpItem::NativeFileOpWindowsShortcutPrepare() if(!flagExists) ret = nsInstall::ACCESS_DENIED; else - tempVar->Delete(0); + tempVar->Remove(0); } } diff --git a/xpinstall/src/nsInstallPatch.cpp b/xpinstall/src/nsInstallPatch.cpp index b9e8a3ef8bcc..1871803f7f56 100644 --- a/xpinstall/src/nsInstallPatch.cpp +++ b/xpinstall/src/nsInstallPatch.cpp @@ -245,7 +245,7 @@ PRInt32 nsInstallPatch::Prepare() mPatchFile->Exists(&flagExists); if ( (mPatchFile != nsnull) && (flagExists) ) { - mPatchFile->Delete(PR_FALSE); + mPatchFile->Remove(PR_FALSE); } @@ -255,7 +255,7 @@ PRInt32 nsInstallPatch::Prepare() mPatchFile->Exists(&flagExists); if ((mPatchedFile != nsnull) && (flagExists)) { - mPatchedFile->Delete(PR_FALSE); + mPatchedFile->Remove(PR_FALSE); } return err; } @@ -610,7 +610,7 @@ nsInstallPatch::NativePatch(nsIFile *sourceFile, nsIFile *patchFile, nsIFile **n outFileSpec->GetParent(getter_AddRefs(parent)); - outFileSpec->Delete(PR_FALSE); + outFileSpec->Remove(PR_FALSE); char* leaf; anotherName->GetLeafName(&leaf); @@ -660,7 +660,7 @@ cleanup: { tempSrcFile->Exists(&flagExists); if (flagExists) - tempSrcFile->Delete(PR_FALSE); + tempSrcFile->Remove(PR_FALSE); } /* lets map any GDIFF error to nice SU errors */ diff --git a/xpinstall/src/nsXPInstallManager.cpp b/xpinstall/src/nsXPInstallManager.cpp index ee181d5dfe07..064dcc58b2d0 100644 --- a/xpinstall/src/nsXPInstallManager.cpp +++ b/xpinstall/src/nsXPInstallManager.cpp @@ -543,7 +543,7 @@ void nsXPInstallManager::Shutdown() { item = NS_STATIC_CAST(nsXPITriggerItem*, mTriggers->Get(i)); if ( item && item->mFile && !item->IsFileURL() ) - item->mFile->Delete(PR_FALSE); + item->mFile->Remove(PR_FALSE); } } @@ -754,7 +754,7 @@ nsXPInstallManager::OnStopRequest(nsIRequest *request, nsISupports *ctxt, nsresult rv2 ; rv2 = mItem->mFile->Exists(&flagExists); if (NS_SUCCEEDED(rv2) && flagExists) - mItem->mFile->Delete(PR_FALSE); + mItem->mFile->Remove(PR_FALSE); mItem->mFile = 0; }