Bug 840758 - Get the profile directory earlier. r=BenWa.

This commit is contained in:
Rafael Ávila de Espíndola 2013-02-13 08:08:40 -05:00
parent a8c1ef95ef
commit 94c8150cf2
6 changed files with 6 additions and 6 deletions

View File

@ -26,6 +26,7 @@ enum ShutdownChecksMode {
};
extern ShutdownChecksMode gShutdownChecks;
void InitWritePoisoning();
void PoisonWrite();
void DisableWritePoisoning();
void EnableWritePoisoning();

View File

@ -41,7 +41,7 @@ std::vector<int>& getDebugFDs() {
return *DebugFDs;
}
void PoisonWriteBase()
void InitWritePoisoning()
{
nsCOMPtr<nsIFile> mozFile;
NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(mozFile));

View File

@ -44,7 +44,6 @@ public:
};
bool PoisonWriteEnabled();
void PoisonWriteBase();
bool ValidWriteAssert(bool ok);
void BaseCleanup();
// This method should always be called with the debugFDs lock.

View File

@ -247,8 +247,6 @@ void PoisonWrite() {
if (!PoisonWriteEnabled())
return;
PoisonWriteBase();
for (int i = 0; i < NumFunctions; ++i) {
FuncData *d = Functions[i];
if (!d->Function)

View File

@ -48,8 +48,6 @@ void PoisonWrite() {
if (!PoisonWriteEnabled())
return;
PoisonWriteBase();
sNtDllInterceptor.Init("ntdll.dll");
sNtDllInterceptor.AddHook("NtFlushBuffersFile", reinterpret_cast<intptr_t>(patched_FlushBuffersFile), reinterpret_cast<void**>(&gOriginalFlushBuffersFile));
}

View File

@ -600,6 +600,10 @@ ShutdownXPCOM(nsIServiceManager* servMgr)
// observers themselves might call ClearOnShutdown().
mozilla::KillClearOnShutdown();
// Write poisoning needs to find the profile directory, so it has to
// be initialized before mozilla::services::Shutdown.
InitWritePoisoning();
// XPCOM is officially in shutdown mode NOW
// Set this only after the observers have been notified as this
// will cause servicemanager to become inaccessible.