Backed out changeset a43ae8497706 (bug 968101)

This commit is contained in:
Ed Morley 2014-03-05 17:25:01 +00:00
parent ad73a3abc3
commit fa2daad1c0
3 changed files with 139 additions and 613 deletions

File diff suppressed because it is too large Load Diff

View File

@ -11,7 +11,6 @@
#include "nsITimer.h"
#include "nsCOMPtr.h"
#include "mozilla/SHA1.h"
#include "mozilla/TimeStamp.h"
#include "nsTArray.h"
#include "nsString.h"
#include "nsTHashtable.h"
@ -20,8 +19,6 @@
//#define DEBUG_HANDLES 1
class nsIFile;
class nsITimer;
class nsIDirectoryEnumerator;
namespace mozilla {
namespace net {
@ -32,7 +29,6 @@ class CacheFileHandlesEntry;
const char kEntriesDir[] = "entries";
const char kDoomedDir[] = "doomed";
const char kTrashDir[] = "trash";
class CacheFileHandle : public nsISupports
@ -307,21 +303,13 @@ private:
nsresult EvictIfOverLimitInternal();
nsresult OverLimitEvictionInternal();
nsresult TrashDirectory(nsIFile *aFile);
static void OnTrashTimer(nsITimer *aTimer, void *aClosure);
nsresult StartRemovingTrash();
nsresult RemoveTrashInternal();
nsresult FindTrashDirToRemove();
nsresult CreateFile(CacheFileHandle *aHandle);
static void HashToStr(const SHA1Sum::Hash *aHash, nsACString &_retval);
static nsresult StrToHash(const nsACString &aHash, SHA1Sum::Hash *_retval);
nsresult GetFile(const SHA1Sum::Hash *aHash, nsIFile **_retval);
nsresult GetSpecialFile(const nsACString &aKey, nsIFile **_retval);
nsresult GetDoomedFile(nsIFile **_retval);
nsresult IsEmptyDirectory(nsIFile *aFile, bool *_retval);
nsresult CheckAndCreateDir(nsIFile *aFile, const char *aDir,
bool aEnsureEmptyDir);
nsresult CheckAndCreateDir(nsIFile *aFile, const char *aDir);
nsresult CreateCacheTree();
nsresult OpenNSPRHandle(CacheFileHandle *aHandle, bool aCreate = false);
void NSPRHandleUsed(CacheFileHandle *aHandle);
@ -331,7 +319,6 @@ private:
nsresult ShutdownMetadataWriteSchedulingInternal();
static CacheFileIOManager *gInstance;
TimeStamp mStartTime;
bool mShuttingDown;
nsRefPtr<CacheIOThread> mIOThread;
nsCOMPtr<nsIFile> mCacheDirectory;
@ -342,11 +329,6 @@ private:
nsTArray<nsRefPtr<CacheFile> > mScheduledMetadataWrites;
nsCOMPtr<nsITimer> mMetadataWritesTimer;
bool mOverLimitEvicting;
bool mRemovingTrashDirs;
nsCOMPtr<nsITimer> mTrashTimer;
nsCOMPtr<nsIFile> mTrashDir;
nsCOMPtr<nsIDirectoryEnumerator> mTrashDirEnumerator;
nsTArray<nsCString> mFailedTrashDirs;
};
} // net

View File

@ -16,7 +16,5 @@ skip-if = os == "android"
[test_notifications_onDeleteVisits.js]
[test_outdated_analyze.js]
[test_pref_interval.js]
# Crashes when timer is used on non-main thread due to JS implemetation in this test
skip-if = "JS implementation of nsITimer"
[test_pref_maxpages.js]
[test_removeAllPages.js]