diff options
author | Matt A. Tobin <email@mattatobin.com> | 2020-02-22 20:10:23 -0500 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2020-04-14 12:52:18 +0200 |
commit | 92edec6f587ae6b86c9b27947113997972ce0c1a (patch) | |
tree | 246706f86a7e5e3e086cf9ac83f7bdcec0055cee /netwerk/cache/nsDeleteDir.cpp | |
parent | 2dea4edfd7cf9a760149da220e60dddb2b0b0d09 (diff) | |
download | UXP-92edec6f587ae6b86c9b27947113997972ce0c1a.tar UXP-92edec6f587ae6b86c9b27947113997972ce0c1a.tar.gz UXP-92edec6f587ae6b86c9b27947113997972ce0c1a.tar.lz UXP-92edec6f587ae6b86c9b27947113997972ce0c1a.tar.xz UXP-92edec6f587ae6b86c9b27947113997972ce0c1a.zip |
Issue #1053 - Remove android support from netwerk
Diffstat (limited to 'netwerk/cache/nsDeleteDir.cpp')
-rw-r--r-- | netwerk/cache/nsDeleteDir.cpp | 30 |
1 files changed, 3 insertions, 27 deletions
diff --git a/netwerk/cache/nsDeleteDir.cpp b/netwerk/cache/nsDeleteDir.cpp index 8c4edf812..b081a12eb 100644 --- a/netwerk/cache/nsDeleteDir.cpp +++ b/netwerk/cache/nsDeleteDir.cpp @@ -235,18 +235,11 @@ nsDeleteDir::DeleteDir(nsIFile *dirIn, bool moveToTrash, uint32_t delay) if (!leaf.Length()) return NS_ERROR_FAILURE; -#if defined(MOZ_WIDGET_ANDROID) - nsCOMPtr<nsIFile> parent; - rv = trash->GetParent(getter_AddRefs(parent)); - if (NS_FAILED(rv)) - return rv; - rv = dir->MoveToNative(parent, leaf); -#else // Important: must rename directory w/o changing parent directory: else on // NTFS we'll wait (with cache lock) while nsIFile's ACL reset walks file // tree: was hanging GUI for *minutes* on large cache dirs. rv = dir->MoveToNative(nullptr, leaf); -#endif + if (NS_FAILED(rv)) return rv; } else { @@ -269,21 +262,6 @@ nsresult nsDeleteDir::GetTrashDir(nsIFile *target, nsCOMPtr<nsIFile> *result) { nsresult rv; -#if defined(MOZ_WIDGET_ANDROID) - // Try to use the app cache folder for cache trash on Android - char* cachePath = getenv("CACHE_DIRECTORY"); - if (cachePath) { - rv = NS_NewNativeLocalFile(nsDependentCString(cachePath), - true, getter_AddRefs(*result)); - if (NS_FAILED(rv)) - return rv; - - // Add a sub folder with the cache folder name - nsAutoCString leaf; - rv = target->GetNativeLeafName(leaf); - (*result)->AppendNative(leaf); - } else -#endif { rv = target->Clone(getter_AddRefs(*result)); } @@ -318,11 +296,9 @@ nsDeleteDir::RemoveOldTrashes(nsIFile *cacheDir) return rv; nsCOMPtr<nsIFile> parent; -#if defined(MOZ_WIDGET_ANDROID) - rv = trash->GetParent(getter_AddRefs(parent)); -#else + rv = cacheDir->GetParent(getter_AddRefs(parent)); -#endif + if (NS_FAILED(rv)) return rv; |