Bug 936964 (part 1) - Make StartupCache ref-counted. r=aklotz.
This commit is contained in:
@@ -110,7 +110,6 @@ StartupCache::GetSingleton()
|
||||
void
|
||||
StartupCache::DeleteSingleton()
|
||||
{
|
||||
delete StartupCache::gStartupCache;
|
||||
StartupCache::gStartupCache = nullptr;
|
||||
}
|
||||
|
||||
@@ -122,17 +121,18 @@ StartupCache::InitSingleton()
|
||||
|
||||
rv = StartupCache::gStartupCache->Init();
|
||||
if (NS_FAILED(rv)) {
|
||||
delete StartupCache::gStartupCache;
|
||||
StartupCache::gStartupCache = nullptr;
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
StartupCache* StartupCache::gStartupCache;
|
||||
StaticRefPtr<StartupCache> StartupCache::gStartupCache;
|
||||
bool StartupCache::gShutdownInitiated;
|
||||
bool StartupCache::gIgnoreDiskCache;
|
||||
enum StartupCache::TelemetrifyAge StartupCache::gPostFlushAgeAction = StartupCache::IGNORE_AGE;
|
||||
|
||||
NS_IMPL_ISUPPORTS1(StartupCache, nsISupports)
|
||||
|
||||
StartupCache::StartupCache()
|
||||
: mArchive(nullptr), mStartupWriteInitiated(false), mWriteThread(nullptr)
|
||||
{ }
|
||||
@@ -156,7 +156,6 @@ StartupCache::~StartupCache()
|
||||
WriteToDisk();
|
||||
}
|
||||
|
||||
gStartupCache = nullptr;
|
||||
NS_UnregisterMemoryReporter(mMappingReporter);
|
||||
NS_UnregisterMemoryReporter(mDataReporter);
|
||||
}
|
||||
@@ -543,7 +542,7 @@ StartupCache::WaitOnWriteThread()
|
||||
mWriteThread = nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
void
|
||||
StartupCache::ThreadedWrite(void *aClosure)
|
||||
{
|
||||
PR_SetCurrentThreadName("StartupCache");
|
||||
|
||||
Reference in New Issue
Block a user