Bug 1165818: Remove temporary Nightly only MozTemp-* clean-up code. r=jimm

This commit is contained in:
Bob Owen 2016-01-27 11:00:09 +00:00
parent 4aa02e1941
commit c127f957a5

View File

@ -688,51 +688,6 @@ SetUpSandboxEnvironment()
} }
} }
#if defined(NIGHTLY_BUILD)
static void
CleanUpOldSandboxEnvironment()
{
// Temporary code to clean up the old low integrity temp directories.
// The removal of this is tracked by bug 1165818.
nsCOMPtr<nsIFile> lowIntegrityMozilla;
nsresult rv = NS_GetSpecialDirectory(NS_WIN_LOW_INTEGRITY_TEMP_BASE,
getter_AddRefs(lowIntegrityMozilla));
if (NS_WARN_IF(NS_FAILED(rv))) {
return;
}
nsCOMPtr<nsISimpleEnumerator> iter;
rv = lowIntegrityMozilla->GetDirectoryEntries(getter_AddRefs(iter));
if (NS_WARN_IF(NS_FAILED(rv))) {
return;
}
bool more;
nsCOMPtr<nsISupports> elem;
while (NS_SUCCEEDED(iter->HasMoreElements(&more)) && more) {
rv = iter->GetNext(getter_AddRefs(elem));
if (NS_FAILED(rv)) {
break;
}
nsCOMPtr<nsIFile> file = do_QueryInterface(elem);
if (!file) {
continue;
}
nsAutoString leafName;
rv = file->GetLeafName(leafName);
if (NS_FAILED(rv)) {
continue;
}
if (leafName.Find(NS_LITERAL_STRING("MozTemp-{")) == 0) {
file->Remove(/* aRecursive */ true);
}
}
}
#endif
static void static void
CleanUpSandboxEnvironment() CleanUpSandboxEnvironment()
{ {
@ -741,10 +696,6 @@ CleanUpSandboxEnvironment()
return; return;
} }
#if defined(NIGHTLY_BUILD)
CleanUpOldSandboxEnvironment();
#endif
// Get temp directory suffix pref. // Get temp directory suffix pref.
nsAdoptingString tempDirSuffix = nsAdoptingString tempDirSuffix =
Preferences::GetString("security.sandbox.content.tempDirSuffix"); Preferences::GetString("security.sandbox.content.tempDirSuffix");